Skip to content

Commit 0444895

Browse files
Merge branch 'main' into aanaseer/fine-tuning-cli
2 parents d404dd1 + 1a85f24 commit 0444895

File tree

843 files changed

+69148
-7412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

843 files changed

+69148
-7412
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33

44
USER vscode
55

6-
RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
6+
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
77
ENV PATH=/home/vscode/.rye/shims:$PATH
88

9-
RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
9+
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
}
2525
}
2626
}
27+
},
28+
"features": {
29+
"ghcr.io/devcontainers/features/node:1": {}
2730
}
2831

2932
// Features to add to the dev container. More info: https://containers.dev/features.

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# This file is used to automatically assign reviewers to PRs
2+
# For more information see: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
3+
14
* @openai/sdks-team

.github/workflows/ci.yml

Lines changed: 86 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,109 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
610
pull_request:
7-
branches:
8-
- main
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
914

1015
jobs:
1116
lint:
17+
timeout-minutes: 10
1218
name: lint
13-
runs-on: ubuntu-latest
14-
if: github.repository == 'openai/openai-python'
15-
19+
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
1620
steps:
1721
- uses: actions/checkout@v4
1822

1923
- name: Install Rye
2024
run: |
21-
curl -sSf https://rye-up.com/get | bash
25+
curl -sSf https://rye.astral.sh/get | bash
2226
echo "$HOME/.rye/shims" >> $GITHUB_PATH
2327
env:
24-
RYE_VERSION: 0.24.0
25-
RYE_INSTALL_OPTION: "--yes"
28+
RYE_VERSION: '0.44.0'
29+
RYE_INSTALL_OPTION: '--yes'
2630

2731
- name: Install dependencies
28-
run: |
29-
rye sync --all-features
32+
run: rye sync --all-features
33+
34+
- name: Run lints
35+
run: ./scripts/lint
36+
37+
upload:
38+
if: github.repository == 'stainless-sdks/openai-python'
39+
timeout-minutes: 10
40+
name: upload
41+
permissions:
42+
contents: read
43+
id-token: write
44+
runs-on: depot-ubuntu-24.04
45+
steps:
46+
- uses: actions/checkout@v4
3047

31-
- name: Run ruff
48+
- name: Get GitHub OIDC Token
49+
id: github-oidc
50+
uses: actions/github-script@v6
51+
with:
52+
script: core.setOutput('github_token', await core.getIDToken());
53+
54+
- name: Upload tarball
55+
env:
56+
URL: https://pkg.stainless.com/s
57+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
58+
SHA: ${{ github.sha }}
59+
run: ./scripts/utils/upload-artifact.sh
60+
61+
test:
62+
timeout-minutes: 10
63+
name: test
64+
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- name: Install Rye
3269
run: |
33-
rye run check:ruff
70+
curl -sSf https://rye.astral.sh/get | bash
71+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
72+
env:
73+
RYE_VERSION: '0.44.0'
74+
RYE_INSTALL_OPTION: '--yes'
75+
76+
- name: Bootstrap
77+
run: ./scripts/bootstrap
78+
79+
- name: Run tests
80+
run: ./scripts/test
81+
82+
examples:
83+
timeout-minutes: 10
84+
name: examples
85+
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
86+
if: github.repository == 'openai/openai-python'
87+
88+
steps:
89+
- uses: actions/checkout@v4
3490

35-
- name: Run type checking
91+
- name: Install Rye
3692
run: |
37-
rye run typecheck
93+
curl -sSf https://rye.astral.sh/get | bash
94+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
95+
env:
96+
RYE_VERSION: '0.44.0'
97+
RYE_INSTALL_OPTION: '--yes'
98+
- name: Install dependencies
99+
run: |
100+
rye sync --all-features
38101
39-
- name: Ensure importable
102+
- env:
103+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
104+
run: |
105+
rye run python examples/demo.py
106+
- env:
107+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
40108
run: |
41-
rye run python -c 'import openai'
109+
rye run python examples/async_demo.py

.github/workflows/create-releases.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
environment: publish
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818

1919
- uses: stainless-api/trigger-release-please@v1
2020
id: release
@@ -25,11 +25,11 @@ jobs:
2525
- name: Install Rye
2626
if: ${{ steps.release.outputs.releases_created }}
2727
run: |
28-
curl -sSf https://rye-up.com/get | bash
28+
curl -sSf https://rye.astral.sh/get | bash
2929
echo "$HOME/.rye/shims" >> $GITHUB_PATH
3030
env:
31-
RYE_VERSION: 0.24.0
32-
RYE_INSTALL_OPTION: "--yes"
31+
RYE_VERSION: '0.44.0'
32+
RYE_INSTALL_OPTION: '--yes'
3333

3434
- name: Publish to PyPI
3535
if: ${{ steps.release.outputs.releases_created }}

.github/workflows/publish-pypi.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ jobs:
88
publish:
99
name: publish
1010
runs-on: ubuntu-latest
11+
environment: publish
1112

1213
steps:
13-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1415

1516
- name: Install Rye
1617
run: |
17-
curl -sSf https://rye-up.com/get | bash
18+
curl -sSf https://rye.astral.sh/get | bash
1819
echo "$HOME/.rye/shims" >> $GITHUB_PATH
1920
env:
20-
RYE_VERSION: 0.24.0
21-
RYE_INSTALL_OPTION: "--yes"
21+
RYE_VERSION: '0.44.0'
22+
RYE_INSTALL_OPTION: '--yes'
2223

2324
- name: Publish to PyPI
2425
run: |

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
if: github.repository == 'openai/openai-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

1818
- name: Check release environment
1919
run: |

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.prism.log
12
.vscode
23
_dev
34

@@ -12,3 +13,8 @@ dist
1213
.env
1314
.envrc
1415
codegen.log
16+
Brewfile.lock.json
17+
18+
.DS_Store
19+
20+
examples/*.mp3

.inline-snapshot/external/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ignore all snapshots which are not refered in the source
2+
*-new.*
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"role":"assistant","content":null,"refusal":""},"logprobs":null,"finish_reason":null}]}
2+
3+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":"I'm"},"logprobs":null,"finish_reason":null}]}
4+
5+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":" sorry"},"logprobs":null,"finish_reason":null}]}
6+
7+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":","},"logprobs":null,"finish_reason":null}]}
8+
9+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":" I"},"logprobs":null,"finish_reason":null}]}
10+
11+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":" can't"},"logprobs":null,"finish_reason":null}]}
12+
13+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":" assist"},"logprobs":null,"finish_reason":null}]}
14+
15+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":" with"},"logprobs":null,"finish_reason":null}]}
16+
17+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":" that"},"logprobs":null,"finish_reason":null}]}
18+
19+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":" request"},"logprobs":null,"finish_reason":null}]}
20+
21+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{"refusal":"."},"logprobs":null,"finish_reason":null}]}
22+
23+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
24+
25+
data: {"id":"chatcmpl-ABfw4IfQfCCrcuybFm41wJyxjbkz7","object":"chat.completion.chunk","created":1727346172,"model":"gpt-4o-2024-08-06","system_fingerprint":"fp_5050236cbd","choices":[],"usage":{"prompt_tokens":79,"completion_tokens":11,"total_tokens":90,"completion_tokens_details":{"reasoning_tokens":0}}}
26+
27+
data: [DONE]
28+

0 commit comments

Comments
 (0)