From a63e64738a99eb4b9cef6bab05b6b090d2e5a001 Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Thu, 18 Dec 2025 19:51:09 +0100 Subject: [PATCH] Added basic test for openAPI llm provider --- .../OpenAPIPromptService/LLMProviderTest.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/Feature/OpenAPIPromptService/LLMProviderTest.php diff --git a/tests/Feature/OpenAPIPromptService/LLMProviderTest.php b/tests/Feature/OpenAPIPromptService/LLMProviderTest.php new file mode 100644 index 0000000..6c975f0 --- /dev/null +++ b/tests/Feature/OpenAPIPromptService/LLMProviderTest.php @@ -0,0 +1,35 @@ +service = new OpenAPIPrompt(); + } + + /** + * A basic feature test example. + */ + public function test_can_respond(): void + { + try { + $response = $this->service->generate(config('llm.models.chat.name'), 'Say "hello world" without any additional text.'); + dump("LLMProviderTest response: " . $response); + $this->assertNotEmpty($response, "LLMProvider returned an empty response."); + $this->assertStringContainsStringIgnoringCase("hello", $response, "LLMProvider response does not contain expected content."); + } + catch (\Exception $e) { + $this->fail("Exception thrown while calling LLMProvider: " . $e->getMessage()); + return; + } + } +}