Skip to content

Commit 6282c3b

Browse files
Add integration test to validate schema with gpt-4
1 parent a2e6245 commit 6282c3b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/gateway/findmcps.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func keywordStrategy(configuration Configuration) mcp.ToolHandler {
3333
// Parse parameters
3434
var params struct {
3535
Query string `json:"query"`
36-
Limit int `json:"limit"`
36+
Limit int `json:"limit"`
3737
}
3838

3939
if req.Params.Arguments == nil {
@@ -198,7 +198,7 @@ func embeddingStrategy(g *Gateway) mcp.ToolHandler {
198198
// Parse parameters
199199
var params struct {
200200
Query string `json:"query"`
201-
Limit int `json:"limit"`
201+
Limit int `json:"limit"`
202202
}
203203

204204
if req.Params.Arguments == nil {

pkg/integration_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func TestIntegrationOpenAIModels(t *testing.T) {
269269
requestJSON, err := json.Marshal(requestBody)
270270
require.NoError(t, err)
271271

272-
req, err := http.NewRequestWithContext(ctx, "POST", openaiURL, bytes.NewBuffer(requestJSON))
272+
req, err := http.NewRequestWithContext(ctx, http.MethodPost, openaiURL, bytes.NewBuffer(requestJSON))
273273
require.NoError(t, err)
274274

275275
req.Header.Set("Content-Type", "application/json")
@@ -294,7 +294,7 @@ func TestIntegrationOpenAIModels(t *testing.T) {
294294
// Verify we got a response with choices
295295
choices, ok := openaiResp["choices"].([]any)
296296
require.True(t, ok, "Response should contain choices")
297-
require.Greater(t, len(choices), 0, "Should have at least one choice")
297+
require.NotEmpty(t, choices, "Should have at least one choice")
298298

299299
fmt.Printf("OpenAI Response: %+v\n", openaiResp)
300300
}

0 commit comments

Comments
 (0)