Skip to content
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

Utilizing multiple function/tools calls? #31

Open
devjn opened this issue Nov 12, 2024 · 5 comments
Open

Utilizing multiple function/tools calls? #31

devjn opened this issue Nov 12, 2024 · 5 comments

Comments

@devjn
Copy link

devjn commented Nov 12, 2024

Can we use function calls instead of JSON mode? Particularly would be nice to get example with Vertex AI Gemini as they don't support Union types.

Currently I can see that when specified Mode.VERTEXAI_TOOLS for instructor, and then for BaseAgentConfig(output_schema=AgentOutputSchema)
I can see from logs that 1 tool is defined like this:
'tools': [function_declarations {
name: "AgentOutputSchema
...
}]

How could we define more tools and instruct correctly?

@devjn devjn changed the title Utilizing function/tools calls with Gemini? Utilizing function/tools calls? Nov 12, 2024
@KennyVaneetvelde
Copy link
Member

Hello, unless I misunderstand your question, I believe this question is more suited for https://github.com/instructor-ai/instructor

Maybe though it's not possible with Vertex AI in tool mode, either way I'm sure the folks at Instructor are more knowledgeable on this specific subject!

@devjn
Copy link
Author

devjn commented Nov 14, 2024

Yeah gemini question seems to be more for instructor. However, currently there is parallel-function-calling that takes Iterable so to utilize it we would need output_schema to allow it. Something like this: BaseAgentConfig(output_schema=Iterable[WeatherSchema | GoogleSearchSchema])

@devjn devjn changed the title Utilizing function/tools calls? Utilizing multiple function/tools calls? Nov 14, 2024
@KennyVaneetvelde
Copy link
Member

@devjn Have you tried this? Anything that works for instructor should work within atomic agents, or is there something specific that's not working or holding you back here?

@devjn
Copy link
Author

devjn commented Nov 15, 2024

@KennyVaneetvelde The issue currently is that BaseAgent expects BaseAgentConfig for output_schema and if I use Iterable I get: ValidationError: 1 validation error for BaseAgentConfig output_schema Input should be a subclass of BaseModel
Or should I not use BaseAgent?

@KennyVaneetvelde
Copy link
Member

Right, The config is just for configuration, but the point still stands as right now it only supports a class that extends from Pydantic's BaseModel but I get what you mean, you need it to accept an iterable...

I will try to look into that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants