From 19b5f8e38869c671c87b24042a6bb5ec1c430042 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Sat, 20 Jan 2024 06:45:56 -0800 Subject: [PATCH] googleai: test GenerateFromSinglePrompt convenience function (#538) --- llms/googleai/googleai_llm_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/llms/googleai/googleai_llm_test.go b/llms/googleai/googleai_llm_test.go index 4e3a48b25..e76cfc6af 100644 --- a/llms/googleai/googleai_llm_test.go +++ b/llms/googleai/googleai_llm_test.go @@ -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)