Skip to content

Commit

Permalink
just test length from generated model response
Browse files Browse the repository at this point in the history
  • Loading branch information
conneroisu committed Oct 16, 2024
1 parent 83a609a commit eeb6982
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ API Documentation: https://console.groq.com/docs/quickstart

Code generated by groq\-modeler DO NOT EDIT.

Created at: 2024\-10\-16 14:22:50
Created at: 2024\-10\-16 14:32:20

groq\-modeler Version 1.1.2

Expand Down
2 changes: 1 addition & 1 deletion models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 49 additions & 17 deletions models_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion scripts/generate-models/models_test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ func TestChatModels{{ $model.Name }}(t *testing.T) {
RetryDelay: time.Second * 2,
})
a.NoError(err, "CreateChatCompletionJSON error")
a.NotEmpty(response.Choices[0].Message.Content, "response.Choices[0].Message.Content is empty for model {{ $model.Name }} calling CreateChatCompletionJSON")
if len(response.Choices[0].Message.Content) == 0 {
t.Errorf("response.Choices[0].Message.Content is empty for model {{ $model.Name }} calling CreateChatCompletion")
}
}
{{- end }}

Expand Down

0 comments on commit eeb6982

Please sign in to comment.