Skip to content

Commit

Permalink
#29: build client init
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger12 committed Dec 19, 2023
1 parent c91a81d commit dd4985e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion pkg/providers/openai/openaiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gopkg.in/yaml.v2"
"os"

"Glide/pkg/providers"
//"Glide/pkg/providers"

"github.com/cloudwego/hertz/pkg/app/client"
"github.com/cloudwego/hertz/pkg/protocol"
Expand All @@ -32,6 +32,25 @@ const (
APITypeAzureAD APIType = "AZURE_AD"
)

type GatewayConfig struct {
Pools []Pool `yaml:"pools"`
}

type Pool struct {
Name string `yaml:"name"`
Balancing string `yaml:"balancing"`
Providers []Provider `yaml:"providers"`
}

type Provider struct {
Name string `yaml:"name"`
Provider string `yaml:"provider"`
Model string `yaml:"model"`
APIKey string `yaml:"api_key"`
TimeoutMs int `yaml:"timeout_ms,omitempty"`
DefaultParams map[string]interface{} `yaml:"default_params,omitempty"`
}

// Client is a client for the OpenAI API.
type Client struct {
apiKey string
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package providers
package provider
type GatewayConfig struct {
Pools []Pool `yaml:"pools"`
}
Expand Down

0 comments on commit dd4985e

Please sign in to comment.