Skip to content

Commit b89ca2e

Browse files
authored
feat: v0.1.1 api updates (#14)
v0.1.1 api updates
1 parent cf7ab71 commit b89ca2e

File tree

30 files changed

+382
-315
lines changed

30 files changed

+382
-315
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"postCreateCommand": "yarn install",
1010
"customizations": {
1111
"vscode": {
12-
"extensions": [
13-
"esbenp.prettier-vscode"
14-
]
12+
"extensions": ["esbenp.prettier-vscode"]
1513
}
1614
}
1715
}

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ jobs:
1212
lint:
1313
name: lint
1414
runs-on: ubuntu-latest
15-
1615

1716
steps:
1817
- uses: actions/checkout@v4
1918

2019
- name: Set up Node
2120
uses: actions/setup-node@v4
2221
with:
23-
node-version: '18'
22+
node-version: '20'
2423

2524
- name: Bootstrap
2625
run: ./scripts/bootstrap
@@ -31,15 +30,14 @@ jobs:
3130
build:
3231
name: build
3332
runs-on: ubuntu-latest
34-
3533

3634
steps:
3735
- uses: actions/checkout@v4
3836

3937
- name: Set up Node
4038
uses: actions/setup-node@v4
4139
with:
42-
node-version: '18'
40+
node-version: '20'
4341

4442
- name: Bootstrap
4543
run: ./scripts/bootstrap
@@ -56,7 +54,7 @@ jobs:
5654
- name: Set up Node
5755
uses: actions/setup-node@v4
5856
with:
59-
node-version: '18'
57+
node-version: '20'
6058

6159
- name: Bootstrap
6260
run: ./scripts/bootstrap

.github/workflows/examples.yml

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,90 +2,90 @@ name: Run Examples
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
8-
workflow_dispatch: # Allows manual triggering
7+
branches: [main]
8+
workflow_dispatch: # Allows manual triggering
99
schedule:
1010
- cron: '0 * * * *' # every hour
1111

1212
jobs:
1313
chat:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
17-
- name: Set up Node
18-
uses: actions/setup-node@v4
19-
with:
20-
node-version: '18'
21-
- name: Install dependencies
22-
env:
23-
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
24-
run: |
25-
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
26-
yarn install
27-
- name: Run chat.ts
28-
env:
29-
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
30-
run: |
31-
yarn tsn -T examples/chat.ts
16+
- uses: actions/checkout@v4
17+
- name: Set up Node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
- name: Install dependencies
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
24+
run: |
25+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
26+
yarn install
27+
- name: Run chat.ts
28+
env:
29+
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
30+
run: |
31+
yarn tsn -T examples/chat.ts
3232
3333
structured:
3434
runs-on: ubuntu-latest
3535
steps:
36-
- uses: actions/checkout@v4
37-
- name: Set up Node
38-
uses: actions/setup-node@v4
39-
with:
40-
node-version: '18'
41-
- name: Install dependencies
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
44-
run: |
45-
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
46-
yarn install
47-
- name: Run structured.ts
48-
env:
49-
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
50-
run: |
51-
yarn tsn -T examples/structured.ts
52-
36+
- uses: actions/checkout@v4
37+
- name: Set up Node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '18'
41+
- name: Install dependencies
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
44+
run: |
45+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
46+
yarn install
47+
- name: Run structured.ts
48+
env:
49+
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
50+
run: |
51+
yarn tsn -T examples/structured.ts
52+
5353
tool_call:
5454
runs-on: ubuntu-latest
5555
steps:
56-
- uses: actions/checkout@v4
57-
- name: Set up Node
58-
uses: actions/setup-node@v4
59-
with:
60-
node-version: '18'
61-
- name: Install dependencies
62-
env:
63-
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
64-
run: |
65-
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
66-
yarn install
67-
- name: Run tool_call.ts
68-
env:
69-
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
70-
run: |
71-
yarn tsn -T examples/tool_call.ts
72-
56+
- uses: actions/checkout@v4
57+
- name: Set up Node
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version: '18'
61+
- name: Install dependencies
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
64+
run: |
65+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
66+
yarn install
67+
- name: Run tool_call.ts
68+
env:
69+
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
70+
run: |
71+
yarn tsn -T examples/tool_call.ts
72+
7373
vision:
7474
runs-on: ubuntu-latest
7575
steps:
76-
- uses: actions/checkout@v4
77-
- name: Set up Node
78-
uses: actions/setup-node@v4
79-
with:
80-
node-version: '18'
81-
- name: Install dependencies
82-
env:
83-
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
84-
run: |
85-
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
86-
yarn install
87-
- name: Run vision.ts
88-
env:
89-
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
90-
run: |
91-
yarn tsn -T examples/vision.ts
76+
- uses: actions/checkout@v4
77+
- name: Set up Node
78+
uses: actions/setup-node@v4
79+
with:
80+
node-version: '18'
81+
- name: Install dependencies
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
84+
run: |
85+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
86+
yarn install
87+
- name: Run vision.ts
88+
env:
89+
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
90+
run: |
91+
yarn tsn -T examples/vision.ts

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ This library provides convenient access to the Llama API Client REST API from se
66

77
The REST API documentation can be found on [https://llama.developer.meta.com/docs](https://llama.developer.meta.com/docs). The full API of this library can be found in [api.md](api.md).
88

9-
109
## Installation
1110

1211
```sh
@@ -406,4 +405,5 @@ If you are interested in other runtime environments, please open or upvote an is
406405
See [the contributing documentation](./CONTRIBUTING.md).
407406

408407
## License
408+
409409
Llama API Typescript SDK is MIT licensed, as found in the LICENSE file.

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Llama API Client please follow the respective company's security reporting guidelines.
19+
or products provided by Llama API Client, please follow the respective company's security reporting guidelines.
2020

2121
### Llama API Client Terms and Policies
2222

23-
Please contact dev-feedback@llama-api.com for any questions or concerns regarding security of our services.
23+
Please contact support@llama.developer.meta.com for any questions or concerns regarding the security of our services.
2424

2525
---
2626

examples/structured.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ async function run(stream: boolean = false) {
8888

8989
// Parse the JSON string into an Address object
9090
if (
91-
typeof response.completion_message.content !== 'string' &&
92-
response.completion_message.content.type === 'text'
91+
typeof response.completion_message?.content !== 'string' &&
92+
response.completion_message.content?.type === 'text'
9393
) {
9494
const address: Address = JSON.parse(response.completion_message.content.text);
9595
console.log(address);

package.json

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "llama-api-client",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "The official TypeScript library for the Llama API Client API",
5-
"author": "Llama API Client <dev-feedback@llama-api.com>",
5+
"author": "Llama API Client <support@llama.developer.meta.com>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",
@@ -17,7 +17,7 @@
1717
"test": "./scripts/test",
1818
"build": "./scripts/build",
1919
"prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1",
20-
"format": "prettier --write --cache --cache-strategy metadata . !dist",
20+
"format": "./scripts/format",
2121
"prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi",
2222
"tsn": "ts-node -r tsconfig-paths/register",
2323
"lint": "./scripts/lint",
@@ -30,9 +30,9 @@
3030
"@swc/jest": "^0.2.29",
3131
"@types/jest": "^29.4.0",
3232
"@types/node": "^20.17.6",
33-
"typescript-eslint": "^8.24.0",
34-
"@typescript-eslint/eslint-plugin": "^8.24.0",
35-
"@typescript-eslint/parser": "^8.24.0",
33+
"typescript-eslint": "8.31.1",
34+
"@typescript-eslint/eslint-plugin": "8.31.1",
35+
"@typescript-eslint/parser": "8.31.1",
3636
"eslint": "^9.20.1",
3737
"eslint-plugin-prettier": "^5.2.3",
3838
"eslint-plugin-unused-imports": "^4.1.4",
@@ -42,17 +42,13 @@
4242
"publint": "^0.2.12",
4343
"ts-jest": "^29.1.0",
4444
"ts-node": "^10.5.0",
45-
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.3/tsc-multi.tgz",
45+
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.4/tsc-multi-1.1.4.tgz",
4646
"tsconfig-paths": "^4.0.0",
47-
"typescript": "^4.8.2"
47+
"typescript": "5.8.3"
4848
},
4949
"resolutions": {
5050
"synckit": "0.8.8"
5151
},
52-
"browser": {
53-
"./internal/shims/getBuiltinModule.mjs": "./internal/shims/nullGetBuiltinModule.mjs",
54-
"./internal/shims/getBuiltinModule.js": "./internal/shims/nullGetBuiltinModule.js"
55-
},
5652
"imports": {
5753
"llama-api-client": ".",
5854
"llama-api-client/*": "./src/*"

scripts/build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ for file in LICENSE CHANGELOG.md; do
1919
if [ -e "${file}" ]; then cp "${file}" dist; fi
2020
done
2121
if [ -e "bin/cli" ]; then
22-
mkdir dist/bin
22+
mkdir -p dist/bin
2323
cp -p "bin/cli" dist/bin/;
2424
fi
25+
if [ -e "bin/migration-config.json" ]; then
26+
mkdir -p dist/bin
27+
cp -p "bin/migration-config.json" dist/bin/;
28+
fi
2529
# this converts the export map paths for the dist directory
2630
# and does a few other minor things
2731
node scripts/utils/make-dist-package-json.cjs > dist/package.json

scripts/format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ cd "$(dirname "$0")/.."
66

77
echo "==> Running eslint --fix"
88
./node_modules/.bin/eslint --fix .
9+
10+
echo "==> Running prettier --write"
11+
# format things eslint didn't
12+
./node_modules/.bin/prettier --write --cache --cache-strategy metadata . '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'

0 commit comments

Comments
 (0)