{"modulePath":"github.com/GoCodeAlone/workflow","version":"v0.66.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package generic\n\nPackage generic provides an AIProvider implementation for any OpenAI-compatible API. This can be used with providers like Ollama, Together AI, Fireworks, vLLM, or any other service that implements the OpenAI chat completions API format.\n\n## Types\n\n```go\ntype Config struct {\n\t// Name is the unique provider name (e.g., \"ollama\", \"together\", \"fireworks\").\n\tName string\n\n\t// BaseURL is the base URL for the API (e.g., \"http://localhost:11434/v1\").\n\tBaseURL string\n\n\t// APIKey is the bearer token for authentication (optional for local providers).\n\tAPIKey string //nolint:gosec // G117: config field\n\n\t// Models lists the models available from this provider.\n\tModels []ai.ModelInfo\n\n\t// Headers adds extra HTTP headers to every request.\n\tHeaders map[string]string\n\n\t// SupportsTools indicates whether this provider supports function/tool calling.\n\tSupportsTools bool\n}\n```\nConfig holds configuration for a generic OpenAI-compatible provider.\n\n```go\ntype Provider struct {\n\t// contains filtered or unexported fields\n}\n```\nProvider implements ai.AIProvider for any OpenAI-compatible API.\n\n```go\nfunc New(cfg Config) (*Provider, error)\n```\nNew creates a new generic OpenAI-compatible provider.\n\n```go\nfunc (p *Provider) Complete(ctx context.Context, req ai.CompletionRequest) (*ai.CompletionResponse, error)\n```\n\n```go\nfunc (p *Provider) CompleteStream(_ context.Context, _ ai.CompletionRequest) (\u003c-chan ai.StreamChunk, error)\n```\n\n```go\nfunc (p *Provider) Models() []ai.ModelInfo\n```\n\n```go\nfunc (p *Provider) Name() string\n```\n\n```go\nfunc (p *Provider) SupportsToolUse() bool\n```\n\n```go\nfunc (p *Provider) ToolComplete(ctx context.Context, req ai.ToolCompletionRequest) (*ai.ToolCompletionResponse, error)\n```\n\n","path":"github.com/GoCodeAlone/workflow/plugin/ai/generic","name":"generic","synopsis":"Package generic provides an AIProvider implementation for any OpenAI-compatible API.","isRedistributable":true}
