Skip to content

Commit

Permalink
googleai: test GenerateFromSinglePrompt convenience function (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliben authored Jan 20, 2024
1 parent 715b8c2 commit 19b5f8e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions llms/googleai/googleai_llm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ func TestMultiContentText(t *testing.T) {
assert.Regexp(t, "(?i)dog|canid|canine", c1.Content)
}

func TestGenerateFromSinglePrompt(t *testing.T) {
t.Parallel()
llm := newClient(t)

prompt := "name all the planets in the solar system"
rsp, err := llms.GenerateFromSinglePrompt(context.Background(), llm, prompt)
require.NoError(t, err)

assert.Regexp(t, "(?i)jupiter", rsp)
}

func TestMultiContentTextStream(t *testing.T) {
t.Parallel()
llm := newClient(t)
Expand Down

0 comments on commit 19b5f8e

Please sign in to comment.