* fix ci
This commit is contained in:
parent
18050872fc
commit
68a5ca8928
1 changed files with 11 additions and 7 deletions
|
|
@ -137,10 +137,10 @@ func NewProvider(ctx context.Context, opts ...Option) (*Provider, error) {
|
||||||
|
|
||||||
// converseParams holds the shared request parameters for Converse and ConverseStream.
|
// converseParams holds the shared request parameters for Converse and ConverseStream.
|
||||||
type converseParams struct {
|
type converseParams struct {
|
||||||
messages []types.Message
|
messages []types.Message
|
||||||
system []types.SystemContentBlock
|
system []types.SystemContentBlock
|
||||||
inferenceConfig *types.InferenceConfiguration
|
inferenceConfig *types.InferenceConfiguration
|
||||||
toolConfig *types.ToolConfiguration
|
toolConfig *types.ToolConfiguration
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildConverseParams(messages []Message, tools []ToolDefinition, options map[string]any) converseParams {
|
func buildConverseParams(messages []Message, tools []ToolDefinition, options map[string]any) converseParams {
|
||||||
|
|
@ -174,10 +174,10 @@ func buildConverseParams(messages []Message, tools []ToolDefinition, options map
|
||||||
}
|
}
|
||||||
|
|
||||||
return converseParams{
|
return converseParams{
|
||||||
messages: bedrockMessages,
|
messages: bedrockMessages,
|
||||||
system: systemPrompts,
|
system: systemPrompts,
|
||||||
inferenceConfig: inferenceConfig,
|
inferenceConfig: inferenceConfig,
|
||||||
toolConfig: toolConfig,
|
toolConfig: toolConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -394,7 +394,11 @@ func parseStreamResponse(
|
||||||
usage = &UsageInfo{
|
usage = &UsageInfo{
|
||||||
PromptTokens: int(aws.ToInt32(e.Value.Usage.InputTokens)),
|
PromptTokens: int(aws.ToInt32(e.Value.Usage.InputTokens)),
|
||||||
CompletionTokens: int(aws.ToInt32(e.Value.Usage.OutputTokens)),
|
CompletionTokens: int(aws.ToInt32(e.Value.Usage.OutputTokens)),
|
||||||
TotalTokens: int(aws.ToInt32(e.Value.Usage.InputTokens)) + int(aws.ToInt32(e.Value.Usage.OutputTokens)),
|
TotalTokens: int(
|
||||||
|
aws.ToInt32(e.Value.Usage.InputTokens),
|
||||||
|
) + int(
|
||||||
|
aws.ToInt32(e.Value.Usage.OutputTokens),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue