-
Notifications
You must be signed in to change notification settings - Fork 174
feat: implement google genai provider #134
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
base: main
Are you sure you want to change the base?
feat: implement google genai provider #134
Conversation
Test summary
|
@evalstate I might have botched any semblance of code quality in this PR. Hopefully by moving the Google provider to |
THANKYOU!!!! I can't wait to play with this - it looks amazing. I'm going to get the other PRs and a couple of defect fixes released in the next day or 2 and then concentrate on bringing this in. I must confess, I did think implementing this would be quite good fun when you got to the different modalities - how has it been so far? |
Oh don't get your hopes too high; this was an hour and a half work coded with I am pretty confident we've got all of the major features working. The rest will most likely be edge-cases that isn't easily covered by the tests. |
Sorry for adding a comment not related to the thread here. But couldn't help ask @monotykamary if you could share the coding agent referred here - "super simple coding agent PoC I'm trying to make" . Quite curios to know how fastagent can be leveraged to make coding agents, that perhaps complements other tools out there including "Cline" that you have mentioned. |
Oh I'll have a quick look 🚀 |
fca0262
to
4aa8dd1
Compare
@rkunnamp An exercise up to the reader... I'm kidding, it's really abusing the DesktopCommander MCP and formatting the agents in a way that pass history to each other. One example would be using an infinite loop and pass history whenever import asyncio
from mcp_agent import RequestParams
from mcp_agent.core.fastagent import FastAgent
...
async def main():
async with fast.run() as agent:
while True:
# Start an interactive session with architect
await agent.interactive(agent="architect")
# Pass architect's history to coder for generation
await agent.coder.generate(agent.architect.message_history)
# Start an interactive session with coder
await agent.interactive(agent="coder")
# Pass architect's history to coder for generation
await agent.architect.generate(agent.coder.message_history)
if __name__ == "__main__":
asyncio.run(main()) There are much better patterns that you can use to inject it directly into a following user prompt, instead of updating the system prompt like this to avoid:
Really, the key player here is the MCP server and the agent architecture is up to you. skydeckai-code, or originally called |
systemPrompt=self.instruction, | ||
parallel_tool_calls=False, | ||
systemPrompt=self.instruction, # System instruction will be mapped in _google_completion | ||
parallel_tool_calls=True, # Assume parallel tool calls are supported by default with native API | ||
max_iterations=10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated default
That's great - looks like structured generation is really solid now. And these models are fast through this native interface - really cool :) I've done another pass of testing and:
Anyway, great stuff so far - think this is a huge enhancement to fast-agent - thanks! |
…tracking for Gemini models
a9c2b21
to
6907b1c
Compare
…le-genai-provider
….com/monotykamary/fast-agent into pr/monotykamary/134-1
….com/monotykamary/fast-agent into pr/monotykamary/134
This PR implements the Google provider for fast-agent using the native
google.genai
library and should resolve #6 .Key changes include:
google.genai.Client
for interacting with Google's generative models.PromptMessageMultipart
andgoogle.genai.types.Content
.GoogleConverter
class to handle data structure conversions.Image test code sample
This work is a step towards fully leveraging the features of the
google.genai
library within fast-agent.