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

Fix tool calling for gemini #426

Merged
merged 2 commits into from
Jul 15, 2024
Merged

Conversation

narengogi
Copy link
Contributor

@narengogi narengogi commented Jul 3, 2024

Title:

  • Updated request and response transformers for gemini models

Description: (optional)

  • Update response schema to handle multiple tools in response
  • Update request schema for tools

// Access your API key as an environment variable (see "Set up your API key" above)
const genAI = new GoogleGenerativeAI(process.env.API_KEY);

// ...

const generativeModel = genAI.getGenerativeModel({
  // Use a model that supports function calling, like a Gemini 1.5 model
  model: "gemini-1.5-flash",

  // Specify the function declaration.
  tools: {
    functionDeclarations: [controlLightFunctionDeclaration],
  },
});

Also added usage tokens while at it

Related Issue:
#335

@narengogi narengogi force-pushed the feat/gemini-updates branch 5 times, most recently from b3259bc to 7af3881 Compare July 9, 2024 07:59
formatting

append portkey to randomuuid

Add index to tool_calls stream map

Add Tool Choice to Gemini

replicate gemini tool calling changes in vertex
@VisargD VisargD merged commit 491d265 into Portkey-AI:main Jul 15, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants