From e3fef6a70177bd0c6285497f2eda66cc9062d730 Mon Sep 17 00:00:00 2001 From: Shai Ber Date: Tue, 19 Mar 2024 14:10:24 +0200 Subject: [PATCH] another fix to test --- openai/example.main.w | 3 +-- openai/openai.test.w | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openai/example.main.w b/openai/example.main.w index e42c3ae7..ea969c12 100644 --- a/openai/example.main.w +++ b/openai/example.main.w @@ -3,8 +3,7 @@ bring "./openai.w" as openai; bring cloud; -let key = new cloud.Secret(name: "my-openai-key"); -let oai = new openai.OpenAI(apiKeySecret: key); +let oai = new openai.OpenAI(apiKey: "my-openai-key"); new cloud.Function(inflight () => { let answer = oai.createCompletion("tell me a short joke", model: "gpt-3.5-turbo", max_tokens: 2048); diff --git a/openai/openai.test.w b/openai/openai.test.w index b32f9272..5ab63fe7 100644 --- a/openai/openai.test.w +++ b/openai/openai.test.w @@ -3,11 +3,11 @@ bring "./openai.w" as openai; bring cloud; -let key = new cloud.Secret(name: "my-openai-key"); -let oai = new openai.OpenAI(apiKeySecret: key); +let key = "my-openai-key"; +let oai = new openai.OpenAI(apiKey: key); test "basic completion" { - let answer = oai.createCompletion("tell me a short joke", max_tokens: 1024, model :"gpt-3.5-turbo"); + let answer = oai.createCompletion("tell me a short joke", model :"gpt-3.5-turbo", max_tokens: 1024); // in tests, the response is just an echo of the request expect.equal(answer, Json.stringify({