-
Notifications
You must be signed in to change notification settings - Fork 310
Add api_key
argument to specify API KEY when creating agents
#268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ca8fc14
to
d27bf50
Compare
Only slight concern here is the AgentConfig/Decorator getting a bit unwieldy. Would you be able to a) add a test to test_provider_keys.py to show create an agent and show the override. b) take a look at the doc site and add a note for this feature (https://github.com/evalstate/fast-agent-docs)? Out of interest - is this a feature you're using in production? |
Indeed, an additional argument/field. This is inspired by Agno, it exposes the classes of providers and provides an argument to set the API KEY programmatically. However, in fast-agent,
Maybe I can do these later today.
Currently, it is not in production, but I want to deploy the online demos that require the users to provide their API KEYs to run. So I need a way to set the API KEY programmatically like Agno. |
Agreed (and good catch picking up the key for auto-sampling). I do wonder about the correct balance here -- would be interested in ideas on how to manage this (if do anything at all -- there's nothing inherently wrong with having a lot of arguments in a config interface). Might be that separating "Model" from "Agent" would be good. You might have noticed I've introduced the A2A types in a few places as they seem to provide a nice way of modelling Agents. One of the things in the short-term plan is to create a new Orchestrator that generates Agents on the fly based on task/agent cards.
Seems reasonable -- do they enter these through the TUI/Command Line or a different way (I quite like the sound of this User Experience). At the moment, a lot of my usage of fast-agent is with Anyway, thanks for the PR and would be interested in further thoughts/PR/commits on any of the above :) |
Agno uses this design and provides different arguments for different providers, which brings better flexibility and stronger control over the model. But the current design of fast-agent is impressive for rapid prototyping. It may need more consideration to balance them.
Maybe I'll integrate fast-agent and streamlit to build the demo APPs, I need to allow some users who don’t know how to use the command line to experience these demos. |
33e7452
to
32bb28a
Compare
32bb28a
to
2ae47b4
Compare
@ufownl -- are you OK if i move the api_key in to request_params? i'm cool either way and don't mind doing the work. wdyt? |
Maybe this is not a good idea, although it is indeed more closely related to API requests, but most providers set the API key when the client is initialized, and |
You're right :) I'll get this merged and released shortly. |
This argument allows us to create agents with different API KEYs at runtime. It helps implement workflows that require users to provide an API KEY.