-
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 (#64)
Signed-off-by: Tomas Pilar <[email protected]>
- Loading branch information
1 parent
1dd4e6f
commit 3db0a19
Showing
29 changed files
with
5,754 additions
and
2,597 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.18.2 |
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
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,4 @@ | ||
#!/bin/bash | ||
|
||
source .env | ||
openapi-typescript $GENAI_DEFAULT_ENDPOINT/docs/json -o ./src/api/schema.d.ts |
Oops, something went wrong.