Skip to content

Commit

Permalink
another fix to test
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaiBer committed Mar 19, 2024
1 parent 0077892 commit e3fef6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions openai/example.main.w
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions openai/openai.test.w
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit e3fef6a

Please sign in to comment.