Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yukinagae/genkit-go-plugins
Firebase Genkit Go Community Plugins
https://github.com/yukinagae/genkit-go-plugins
chatgpt firebase firebase-genkit genkit genkit-plugin go golang gpt openai plugin
Last synced: 3 months ago
JSON representation
Firebase Genkit Go Community Plugins
- Host: GitHub
- URL: https://github.com/yukinagae/genkit-go-plugins
- Owner: yukinagae
- License: apache-2.0
- Created: 2024-08-26T16:02:26.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-03T13:23:06.000Z (4 months ago)
- Last Synced: 2024-09-27T22:03:11.875Z (3 months ago)
- Topics: chatgpt, firebase, firebase-genkit, genkit, genkit-plugin, go, golang, gpt, openai, plugin
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> [!WARNING]
> **This version is in preview and may have API changes and critical bugs. Use it for prototypes or hobby projects, not in production**.# Firebase Genkit Go Community Plugins
[![Go Reference](https://pkg.go.dev/badge/github.com/yukinagae/genkit-go-plugins.svg)](https://pkg.go.dev/github.com/yukinagae/genkit-go-plugins)
[![Go Report Card](https://goreportcard.com/badge/github.com/yukinagae/genkit-go-plugins)](https://goreportcard.com/report/github.com/yukinagae/genkit-go-plugins)
[![GitHub License](https://img.shields.io/github/license/yukinagae/genkit-go-plugins)](https://github.com/yukinagae/genkit-go-plugins/blob/main/LICENSE)This repository contains Go community plugins for [Firebase Genkit](https://github.com/firebase/genkit).
## Available plugins
### Model / Embedding Plugins
- openai - Plugins for OpenAI APIs
## Installation
```bash
go get github.com/yukinagae/genkit-go-plugins@latest
```## Usage
### OpenAI
Get your OpenAI API key from [here](https://platform.openai.com/account/api-keys) and run:
```bash
export OPENAI_API_KEY=your-api-key
```Run `genkit start -o` with the following sample code:
```go
package mainimport (
"context"
"fmt"
"log""github.com/firebase/genkit/go/ai"
"github.com/firebase/genkit/go/genkit""github.com/yukinagae/genkit-go-plugins/plugins/openai"
)func main() {
ctx := context.Background()if err := openai.Init(ctx, nil); err != nil {
log.Fatal(err)
}genkit.DefineFlow("sampleFlow", func(ctx context.Context, input string) (string, error) {
model := openai.Model("gpt-4o-mini")resp, err := model.Generate(ctx,
ai.NewGenerateRequest(
&ai.GenerationCommonConfig{Temperature: 1},
ai.NewUserTextMessage("Hello!")),
nil)
if err != nil {
return "", err
}text := resp.Text()
return text, nil
})if err := genkit.Init(ctx, nil); err != nil {
log.Fatal(err)
}
}
```See the official [Genkit Go Documentation](https://firebase.google.com/docs/genkit-go/get-started-go) for more details.
## Contributing
We welcome contributions to this project! To get started, please refer to our [Contribution Guide](https://github.com/yukinagae/genkit-go-plugins/blob/main/CONTRIBUTING.md).