Skip to content

Commit

Permalink
Change the client init in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
KATTA-00 committed Aug 21, 2024
1 parent b5a7133 commit 5b6b81e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/Sarcastic-bot/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const VALIDATION_FILENAME = "validation.jsonl";
const TRAINING_FILEPATH = "./data/" + TRAINING_FILENAME;
const VALIDATION_FILEPATH = "./data/" + VALIDATION_FILENAME;

final finetunes:ConnectionConfig config = {auth: {token}};
final finetunes:Client openAIFinetunes = check new finetunes:Client(config, SERVICE_URL);

public function main() returns error? {

final finetunes:ConnectionConfig config = {auth: {token}};
final finetunes:Client openAIFinetunes = check new finetunes:Client(config, SERVICE_URL);

byte[] trainingFileContent = check io:fileReadBytes(TRAINING_FILEPATH);
byte[] validationFileContent = check io:fileReadBytes(VALIDATION_FILEPATH);

Expand Down
6 changes: 3 additions & 3 deletions examples/Sports-headline-analyzer/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ string SERVICE_URL = "https://api.openai.com/v1";
string TRAINING_FILENAME = "training.jsonl";
string TRAINING_FILEPATH = "./data/" + TRAINING_FILENAME;

final finetunes:ConnectionConfig config = {auth: {token}};
final finetunes:Client openAIFinetunes = check new finetunes:Client(config, SERVICE_URL);

public function main() returns error? {

final finetunes:ConnectionConfig config = {auth: {token}};
final finetunes:Client openAIFinetunes = check new finetunes:Client(config, SERVICE_URL);

byte[] trainingFileContent = check io:fileReadBytes(TRAINING_FILEPATH);

finetunes:CreateFileRequest trainingFileRequest = {
Expand Down

0 comments on commit 5b6b81e

Please sign in to comment.