VRSEN / agency-swarm

The only reliable agent framework built on top of the latest OpenAI Assistants API.
https://vrsen.github.io/agency-swarm/
MIT License
2.75k stars 729 forks source link

third party model support for genesis command #173

Open phact opened 2 months ago

phact commented 2 months ago

Addresses https://github.com/VRSEN/agency-swarm/issues/160

Usage example (for claude but usage is similar for other providers):

ANTHROPIC_API_KEY=<key goes here> agency-swarm genesis --model claude-3-5-sonnet-20240620

Or set your creds in .env

rhessing commented 2 weeks ago

I believe astra-assistants requires an API key to be operational: export ASTRA_DB_APPLICATION_TOKEN=""

And/Or (not sure either both or one of the other) you will need to host your own astra-assistants API server locally and point the python client to that server: export base_url="http://localhost:8080/v1"

@phact ? Not sure if I've read the code correctly but these changes should also allow for:

from agency_swarm import Agent

ceo = Agent(name="CEO",
            description="Responsible for client communication, task planning and management.",
            instructions="You must converse with other agents to ensure complete task execution.", # can be a file like ./instructions.md
            files_folder="./files", # files to be uploaded to OpenAI
            schemas_folder="./schemas", # OpenAPI schemas to be converted into tools
            tools=[MyCustomTool], 
            model="claude-3-5-sonnet-20240620"
            temperature=0.5, # temperature for the agent
            max_prompt_tokens=25000, # max tokens in conversation history
            )
phact commented 1 week ago

@rhessing correct, if you choose a non-openai model (like model="claude-3-5-sonnet-20240620" in your example) then you'll also need to pass an ASTRA_DB_APPLICATION_TOKEN env var.

And yes, you can optionally host astra-assistants yourself and pass BASE_URL env var.

bonk1t commented 1 week ago

Thank you, @phact! I’ll merge this as soon as I test it.