Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bifrost.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func (bifrost *Bifrost) createProviderFromProviderKey(providerKey interfaces.Sup
return providers.NewBedrockProvider(config), nil
case interfaces.Cohere:
return providers.NewCohereProvider(config), nil
case interfaces.Azure:
return providers.NewAzureProvider(config, bifrost.logger), nil
default:
return nil, fmt.Errorf("unsupported provider: %s", providerKey)
}
Expand Down
19 changes: 14 additions & 5 deletions interfaces/bifrost.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ type ModelParameters struct {
}

type FunctionParameters struct {
Type string `json:"type,"`
Required []string `json:"required"`
Properties map[string]interface{} `json:"properties"`
Type string `json:"type,"`
Description *string `json:"description,omitempty"`
Required []string `json:"required"`
Properties map[string]interface{} `json:"properties"`
}

// Function represents a function definition for tool calls
Expand Down Expand Up @@ -165,9 +166,17 @@ type ContentLogProb struct {
TopLogProbs []LogProb `json:"top_logprobs"`
}

type TextCompletionLogProb struct {
TextOffset []int `json:"text_offset"`
TokenLogProbs []float64 `json:"token_logprobs"`
Tokens []string `json:"tokens"`
TopLogProbs []map[string]float64 `json:"top_logprobs"`
}

type LogProbs struct {
Content []ContentLogProb `json:"content"`
Refusal []LogProb `json:"refusal"`
Content []ContentLogProb `json:"content,omitempty"`
Refusal []LogProb `json:"refusal,omitempty"`
Text TextCompletionLogProb `json:"text,omitempty"`
}

type FunctionCall struct {
Expand Down
39 changes: 39 additions & 0 deletions interfaces/meta/azure.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package meta

type AzureMetaConfig struct {
Endpoint string `json:"endpoint"`
Deployments map[string]string `json:"deployments,omitempty"`
APIVersion *string `json:"api_version,omitempty"`
}

func (c *AzureMetaConfig) GetSecretAccessKey() *string {
return nil
}

func (c *AzureMetaConfig) GetRegion() *string {
return nil
}

func (c *AzureMetaConfig) GetSessionToken() *string {
return nil
}

func (c *AzureMetaConfig) GetARN() *string {
return nil
}

func (c *AzureMetaConfig) GetInferenceProfiles() map[string]string {
return nil
}

func (c *AzureMetaConfig) GetEndpoint() *string {
return &c.Endpoint
}

func (c *AzureMetaConfig) GetDeployments() map[string]string {
return c.Deployments
}

func (c *AzureMetaConfig) GetAPIVersion() *string {
return c.APIVersion
}
12 changes: 12 additions & 0 deletions interfaces/meta/bedrock.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ func (c *BedrockMetaConfig) GetARN() *string {
func (c *BedrockMetaConfig) GetInferenceProfiles() map[string]string {
return c.InferenceProfiles
}

func (c *BedrockMetaConfig) GetEndpoint() *string {
return nil
}

func (c *BedrockMetaConfig) GetDeployments() map[string]string {
return nil
}

func (c *BedrockMetaConfig) GetAPIVersion() *string {
return nil
}
3 changes: 3 additions & 0 deletions interfaces/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ type MetaConfig interface {
GetSessionToken() *string
GetARN() *string
GetInferenceProfiles() map[string]string
GetEndpoint() *string
GetDeployments() map[string]string
GetAPIVersion() *string
}

type ConcurrencyAndBufferSize struct {
Expand Down
Loading