Package Exports
- @robota-sdk/google
- @robota-sdk/google/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@robota-sdk/google) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@robota-sdk/google
Google AI integration for the Robota SDK, providing seamless access to Google's Gemini models.
Features
- Gemini Models: Support for Gemini 1.5 Pro, Gemini 1.5 Flash, and other Google AI models
- Streaming Support: Real-time response streaming for enhanced user experience
- Function Calling: Full support for Google AI function calling capabilities
- TypeScript: Complete type safety with TypeScript support
- Unified API: Consistent interface across all Robota SDK providers
Installation
npm install @robota-sdk/google @robota-sdk/agentsQuick Start
import { GoogleProvider } from '@robota-sdk/google';
import { Robota } from '@robota-sdk/agents';
// Initialize the Google provider
const provider = new GoogleProvider({
apiKey: process.env.GOOGLE_AI_API_KEY
});
// Create a Robota instance
const robota = new Robota({
name: 'GoogleAgent',
aiProviders: [provider],
defaultModel: {
provider: 'google',
model: 'gemini-1.5-pro',
systemMessage: 'You are a helpful AI assistant.'
}
});
// Start chatting
const response = await robota.run('Hello, how can you help me today?');
console.log(response);Configuration
const provider = new GoogleProvider({
apiKey: 'your-google-ai-api-key'
});
// Model configuration is set in Robota's defaultModel
const robota = new Robota({
name: 'GoogleAgent',
aiProviders: [provider],
defaultModel: {
provider: 'google',
model: 'gemini-1.5-pro', // or 'gemini-1.5-flash'
temperature: 0.7,
maxTokens: 1000
}
});Supported Models
gemini-1.5-pro- Most capable model for complex tasksgemini-1.5-flash- Fast and efficient for simpler tasksgemini-pro- Previous generation model
Environment Variables
GOOGLE_AI_API_KEY=your_google_ai_api_key_hereDocumentation
For complete documentation, examples, and API reference, visit:
License
MIT License - see LICENSE file for details.