feat: add configurable AgentRouter AI provider

This commit is contained in:
2026-08-22 21:47:41 +08:00
parent 4f91726edb
commit cf2f114dc8
20 changed files with 1204 additions and 79 deletions

View File

@@ -38,11 +38,18 @@ type Usage struct {
EstimatedCost string
}
type Generator interface {
Model() string
Generate(context.Context, Request) (json.RawMessage, Usage, error)
}
type Client struct {
config Config
client *http.Client
}
var _ Generator = (*Client)(nil)
func New(config Config, client *http.Client) *Client {
if config.BaseURL == "" {
config.BaseURL = "https://api.avalai.ir"