-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
we should have a /provider command. This will be implemented with something like:
provider = model["provider_code"]
if provider == 'anthropic':
provider_client = AsyncOpenAI(
api_key=os.getenv("ANTHROPIC_API_KEY"),
max_retries=0,
base_url="https://api.anthropic.com/v1/",
)
client = OpenAIAgent(provider_client, system_prompt=system_prompt, model=model["model_code"], tools=tools, messages=messages)
return client
elif provider == 'openai':
provider_client = AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY"), max_retries=0)
client = OpenAIAgent(provider_client, system_prompt=system_prompt, model=model["model_code"], tools=tools, messages=messages)
return client
elif provider == 'deepseek':
provider_client = AsyncOpenAI(
api_key=os.getenv("DEEPSEEK_API_KEY"),
base_url="https://api.deepseek.com",
)
client = OpenAIAgent(provider_client, system_prompt=system_prompt, model=model["model_code"], tools=tools, messages=messages)
return client
elif provider == 'meta':
provider_client = AsyncOpenAI(
api_key=os.getenv("LLAMA_API_KEY"),
base_url="https://api.llama.com/compat/v1/",
)
client = OpenAIAgent(provider_client, system_prompt=system_prompt, model=model["model_code"], tools=tools, messages=messages)
return client
need to decide if it should preserve or clear message history.
once a new 'provider' is set, the new provider should be used for other 'roles' as well.
This could also be done lazily - set a new default provider and then use it next time a role is changed.
Metadata
Metadata
Assignees
Labels
No labels