Skip to content

togo-framework/ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

togo

togo-framework/ai

marketplace pkg.go.dev MIT

Part of the togo framework.

Install

togo install togo-framework/ai

togo · ai

The AI plugin for togo — a unified LLM interface with a pluggable provider driver registry. Install a provider plugin and select it with AI_DRIVER.

togo install togo-framework/ai
togo install togo-framework/ai-openai   # then set AI_DRIVER=openai, OPENAI_API_KEY=…

Interface

type Provider interface {
    Chat(ctx, ChatRequest) (ChatResponse, error)
    Embed(ctx, EmbedRequest) (EmbedResponse, error)
}
// optional: Streamer { ChatStream(ctx, req, onChunk) }

Usage

svc, _ := ai.FromKernel(k)
resp, _ := svc.Chat(ctx, ai.ChatRequest{Messages: []ai.Message{{Role: ai.RoleUser, Content: "Hi"}}})
fmt.Println(resp.Content, resp.Usage.TotalTokens)

REST: mount ai.Handler(k) under /api/aiPOST /chat, POST /embed.

Providers

ai-openai · ai-anthropic · ai-gemini · ai-ollama · ai-grok · ai-deepseek · ai-qwen · ai-adk · ai-agno. Capabilities: ai-rag, ai-agentops. The built-in echo driver is the safe dev default (no external calls).

MIT


Premium sponsors

ID8 Media  ·  One Studio

Support togo — become a sponsor.

About

togo AI plugin — unified LLM interface (chat/embed/tools/stream) with a pluggable provider driver registry (openai, anthropic, gemini, ollama, …)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages