Skip to content

Commit

Permalink
fix: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
namwoam committed Jul 8, 2024
1 parent 5b0a01b commit 4f0a13a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ai/cohere/v0/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestComponent_Tasks(t *testing.T) {
wantResp textGenerationOutput
}{
input: map[string]any{"model-name": "command-r-plus"},
wantResp: textGenerationOutput{Text: "Hi! My name is command-r-plus.", Ciatations: []ciatation{}, Usage: commandUsage{InputTokens: 20, OutputTokens: 30}},
wantResp: textGenerationOutput{Text: "Hi! My name is command-r-plus.", Citations: []citation{}, Usage: commandUsage{InputTokens: 20, OutputTokens: 30}},
}

c.Run("ok - task command", func(c *qt.C) {
Expand Down
16 changes: 8 additions & 8 deletions ai/cohere/v0/text_generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type textGenerationInput struct {
Documents []string `json:"documents"`
}

type ciatation struct {
type citation struct {
Start int `json:"start"`
End int `json:"end"`
Text string `json:"text"`
Expand All @@ -47,9 +47,9 @@ type commandUsage struct {
}

type textGenerationOutput struct {
Text string `json:"text"`
Ciatations []ciatation `json:"citations"`
Usage commandUsage `json:"usage"`
Text string `json:"text"`
Citations []citation `json:"citations"`
Usage commandUsage `json:"usage"`
}

func (e *execution) taskTextGeneration(in *structpb.Struct) (*structpb.Struct, error) {
Expand Down Expand Up @@ -109,10 +109,10 @@ func (e *execution) taskTextGeneration(in *structpb.Struct) (*structpb.Struct, e
return nil, err
}

citations := []ciatation{}
citations := []citation{}

for _, c := range resp.Citations {
citation := ciatation{
citation := citation{
Start: c.Start,
End: c.End,
Text: c.Text,
Expand All @@ -124,8 +124,8 @@ func (e *execution) taskTextGeneration(in *structpb.Struct) (*structpb.Struct, e
outputTokens := *bills.OutputTokens

outputStruct := textGenerationOutput{
Text: resp.Text,
Ciatations: citations,
Text: resp.Text,
Citations: citations,
Usage: commandUsage{
InputTokens: int(inputTokens),
OutputTokens: int(outputTokens),
Expand Down

0 comments on commit 4f0a13a

Please sign in to comment.