feat: add configurable AgentRouter AI provider
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user