Skip to content

Commit

Permalink
Add tests for unmarshalling union types
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Sun <dsun20@bloomberg.net>
  • Loading branch information
yuzisun committed Jan 7, 2025
1 parent e42e1e6 commit 5bce3d0
Show file tree
Hide file tree
Showing 5 changed files with 469 additions and 82 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ require (
github.com/aws/aws-sdk-go-v2/config v1.28.7
github.com/envoyproxy/gateway v1.2.4
github.com/envoyproxy/go-control-plane/envoy v1.32.2
github.com/openai/openai-go v0.1.0-alpha.43
github.com/google/go-cmp v0.6.0
github.com/openai/openai-go v0.1.0-alpha.43
github.com/stretchr/testify v1.10.0
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e
google.golang.org/grpc v1.69.2
Expand Down
18 changes: 9 additions & 9 deletions internal/apischema/awsbedrock/awsbedrock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ import (
)

const (
// StopReasonEndTurn is a StopReason enum value
// StopReasonEndTurn is a StopReason enum value.
StopReasonEndTurn = "end_turn"

// StopReasonToolUse is a StopReason enum value
// StopReasonToolUse is a StopReason enum value.
StopReasonToolUse = "tool_use"

// StopReasonMaxTokens is a StopReason enum value
// StopReasonMaxTokens is a StopReason enum value.
StopReasonMaxTokens = "max_tokens"

// StopReasonStopSequence is a StopReason enum value
// StopReasonStopSequence is a StopReason enum value.
StopReasonStopSequence = "stop_sequence"

// StopReasonGuardrailIntervened is a StopReason enum value
// StopReasonGuardrailIntervened is a StopReason enum value.
StopReasonGuardrailIntervened = "guardrail_intervened"

// StopReasonContentFiltered is a StopReason enum value
// StopReasonContentFiltered is a StopReason enum value.
StopReasonContentFiltered = "content_filtered"

// ConversationRoleUser is a ConversationRole enum value
// ConversationRoleUser is a ConversationRole enum value.
ConversationRoleUser = "user"

// ConversationRoleAssistant is a ConversationRole enum value
// ConversationRoleAssistant is a ConversationRole enum value.
ConversationRoleAssistant = "assistant"
)

Expand Down Expand Up @@ -441,7 +441,7 @@ type Tool struct {
ToolSpec *ToolSpecification `json:"toolSpec"`
}

// ToolInputSchema The schema for the tool. The top level schema type must be object.
// ToolInputSchema The schema for the tool. The top level schema type must be an object.
type ToolInputSchema struct {
JSON any `json:"json"`
}
Expand Down
Loading

0 comments on commit 5bce3d0

Please sign in to comment.