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({