picoclaw/pkg/providers/http_provider.go

32 lines
800 B
Go
Raw Normal View History

2026-02-04 11:06:13 +00:00
// PicoClaw - Ultra-lightweight personal AI agent
// Inspired by and based on nanobot: https://github.com/HKUDS/nanobot
// License: MIT
//
// Copyright (c) 2026 PicoClaw contributors
package providers
import (
"context"
2026-02-18 14:26:35 +00:00
"github.com/sipeed/picoclaw/pkg/providers/openai_compat"
2026-02-04 11:06:13 +00:00
)
type HTTPProvider struct {
delegate *openai_compat.Provider
2026-02-04 11:06:13 +00:00
}
func NewHTTPProvider(apiKey, apiBase, proxy string) *HTTPProvider {
2026-02-04 11:06:13 +00:00
return &HTTPProvider{
delegate: openai_compat.NewProvider(apiKey, apiBase, proxy),
2026-02-04 11:06:13 +00:00
}
}
func (p *HTTPProvider) Chat(ctx context.Context, messages []Message, tools []ToolDefinition, model string, options map[string]interface{}) (*LLMResponse, error) {
return p.delegate.Chat(ctx, messages, tools, model, options)
2026-02-04 11:06:13 +00:00
}
func (p *HTTPProvider) GetDefaultModel() string {
return ""
}