Skip to content

ipfans/genkit-plugin-volcengine

Repository files navigation

GenKit Plugin for VolcEngine

A Go plugin for Firebase GenKit that provides seamless integration with VolcEngine's models. This plugin enables developers to leverage advanced AI capabilities including text generation, streaming responses, tool calling, and multimodal support.

✨ Features

  • 🚀 Text Generation: Support for various Doubao and DeepSeek models
  • 📡 Streaming Support: Real-time response streaming for better user experience
  • 🛠️ Tool Calling: Function calling capabilities for complex AI workflows
  • 🎯 Multimodal Support: Handle text, images, audio, and video inputs
  • High Performance: Optimized for production workloads
  • 🔧 Easy Configuration: Multiple initialization methods for different use cases

📦 Installation

Prerequisites

Install the Plugin

go get github.com/ipfans/genkit-plugin-volcengine

Import in Your Project

import (
    "github.com/firebase/genkit/go/genkit"
    volcengine "github.com/ipfans/genkit-plugin-volcengine"
)

🚀 Quick Start

Basic Setup

    // Initialize GenKit with VolcEngine plugin
    genkit.Init(
        ctx,
        genkit.WithPlugins(
            volcengine.VolcEngineWithAPIKey(
                os.Getenv("VOLCENGINE_API_KEY"),
            ),
        ),
    )

Environment Configuration

Set your VolcEngine API key:

export VOLCENGINE_API_KEY="your_volcengine_api_key_here"

Or create a .env file:

echo "VOLCENGINE_API_KEY=your_volcengine_api_key_here" > .env

📊 Supported Models

Model Type Capabilities Latest Version
doubao-seed-1-6 Multimodal Text, Images, Audio, Video, Tools doubao-seed-1-6-250615
doubao-seed-1-6-vision Multimodal Text, Images, Audio, Video, Tools doubao-seed-1-6-vision-250815
doubao-seed-1-6-flash Multimodal Text, Images, Audio, Video, Tools doubao-seed-1-6-flash-250828
deepseek-r1 Text Text Generation, Tools deepseek-r1-250120
deepseek-v3 Text Text Generation, Tools deepseek-v3-250324
deepseek-v3-1 Text Text Generation, Tools deepseek-v3-1-250821

Model Features

  • Multiturn Conversations: All models support conversation history
  • Tool Calling: Function calling for external integrations
  • System Messages: Custom system prompts for behavior control
  • Streaming: Real-time response generation
  • Multimodal: Image, audio, and video support (Doubao models only)

⚙️ Configuration Options

Plugin Initialization

With API Key

volcengine.VolcEngineWithAPIKey("your_api_key")

With Custom Client

volcengine.VolcEngineWithClient(client)

🛠️ Development

Building the Project

# Clone the repository
git clone https://github.com/ipfans/genkit-plugin-volcengine.git
cd genkit-plugin-volcengine

# Build the module
go build

# Run tests
go test ./...

# Update dependencies
go mod tidy

Code Quality

# Format code
go fmt ./...

# Vet code
go vet ./...

# Static analysis
golangci-lint run

Example Project

Check out the example directory for a complete working example that demonstrates:

  • Basic setup and configuration
  • Model selection and usage
  • Development server setup
  • Task automation with Taskfile

🔧 Troubleshooting

Common Issues

API Key Not Set

Error: VOLCENGINE_API_KEY environment variable is not set
Solution: Set the environment variable or pass the key during initialization

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

Reporting Issues

Please use the GitHub Issues page to report bugs or request features.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

🔗 Related Links

About

This plugin provides a simple interface for using volcengine services with Genkit Go

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages