refactor: Improve Elasticsearch query construction and error handling

This commit is contained in:
wizardchen
2025-11-25 22:06:43 +08:00
parent 64c44c9e27
commit 2f45bf7d86
12 changed files with 158 additions and 154 deletions
+1
View File
@@ -110,6 +110,7 @@ func TestRemoteAPIChat(t *testing.T) {
t.Run("Basic Chat", func(t *testing.T) {
response, err := chat.Chat(ctx, testMessages, testOptions)
require.NoError(t, err)
require.NotNil(t, response, "response should not be nil")
assert.NotEmpty(t, response.Content)
assert.Greater(t, response.Usage.TotalTokens, 0)
assert.Greater(t, response.Usage.PromptTokens, 0)