mirror of
https://github.com/kyledickey/gollm.git
synced 2026-10-31 12:25:32 +00:00
A Go library which provides a simple interface for interacting with any LLM.
- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| factory.go | ||
| go.mod | ||
| go.sum | ||
| interface.go | ||
| LICENSE | ||
| openai.go | ||
| README.md | ||
| types.go | ||
gollm
gollm is a Go library which provides a simple interface for interacting with any LLM in Go.
Usage
go get github.com/dickeyy/gollm
model, err := gollm.InitializeModel("gpt-4o-mini", "your-api-key")
if err != nil { panic(err) }
res, err := model.Chat(gollm.ChatStructure{
Messages: []gollm.ChatMessage{
{
Role: "user",
Content: "Hello, how are you?"
},
},
})
if err != nil { panic(err) }
fmt.Println(res.Text)
Supported Models
- OpenAI:
- GPT-4o-mini (
gpt-4o-mini) - GPT-4o (
gpt-4o) - GPT-3.5-turbo (
gpt-3.5-turbo)
- GPT-4o-mini (
More models coming soon!
License
This project is licensed under the MIT License. See the LICENSE file for details.