-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(v2): switch to generated fetch API stub
- Loading branch information
Tomas Pilar
committed
Nov 27, 2023
1 parent
40871a8
commit 80effcc
Showing
24 changed files
with
4,241 additions
and
2,461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
GENAI_DEFAULT_ENDPOINT=https://workbench-api.res.ibm.com | ||
GENAI_DEFAULT_ENDPOINT=https://bam-api.res.ibm.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
/dist/**/* | ||
.eslintrc.cjs | ||
tsup.config.ts | ||
|
||
# generated files | ||
/src/api/schema.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
lts/* | ||
v18.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ node_modules/ | |
.yarn/ | ||
yarn.lock | ||
.pnp.* | ||
|
||
/src/api/schema.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
import { readFileSync } from 'fs'; | ||
|
||
import { GenerateInputSchema } from '../src/index.js'; | ||
|
||
export const loadGenerateInput = () => | ||
// Input files usually follow JSONL format | ||
readFileSync('examples/assets/generate_input.jsonl', 'utf8') | ||
.split('\n') | ||
.map((line) => JSON.stringify(line)) | ||
.map((input) => | ||
GenerateInputSchema.parse({ | ||
model_id: 'default', | ||
input, | ||
}), | ||
); | ||
.map((input) => ({ | ||
model_id: 'google/flan-ul2', | ||
input, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Client } from '../src/index.js'; | ||
|
||
const client = new Client({ | ||
apiKey: process.env.GENAI_API_KEY, | ||
}); | ||
|
||
const models = await client.models({ limit: 100, offset: 0 }); | ||
console.log(models); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.