Skip to content

Commit

Permalink
V1 (openai#677)
Browse files Browse the repository at this point in the history
* cleanup

* v1.0.0-beta.1

* docs: add basic manual azure example

* docs: use chat completions instead of completions for demo example

* test: rename `API_BASE_URL` to `TEST_API_BASE_URL`

* feat(client): handle retry-after header with a date format

* feat(api): remove `content_filter` stop_reason and update documentation

* refactor(cli): rename internal types for improved auto complete

* feat(client): add forwards-compatible pydantic methods

* feat(api): move `n_epochs` under `hyperparameters`

* feat(client): add support for passing in a httpx client

* chore: update README

* feat(cli): use http/2 if h2 is available

* chore(docs): remove trailing spaces

* feat(client): add logging setup

* chore(internal): minor updates

* v1.0.0-beta.2

* docs: use chat completions instead of completions for demo example

* chore: add case insensitive get header function

* fix(client): correctly handle errors during streaming

* fix(streaming): add additional overload for ambiguous stream param

* chore(internal): enable lint rule

* chore(internal): cleanup some redundant code

* fix(client): accept io.IOBase instances in file params

* docs: improve error message for invalid file param type

* 1.0.0-beta.3

* chore(internal): migrate from Poetry to Rye

* feat(cli): add `tools fine_tunes.prepare_data`

* feat(client): support passing httpx.URL instances to base_url

* chore(internal): fix some latent type errors

* feat(api): add embeddings encoding_format

* feat: use numpy for faster embeddings decoding

* chore(internal): bump pyright

* chore(internal): bump deps

* feat(client): improve file upload types

* feat(client): adjust retry behavior to be exponential backoff

* ci: add lint workflow

* docs: improve to dictionary example

* ci(lint): run ruff too

* chore(internal): require explicit overrides

* feat(client): support accessing raw response objects

* test(qs): add an additional test case for array brackets

* feat(client): add dedicated Azure client

* feat(package): add classifiers

* docs(readme): add Azure guide

* 1.0.0-rc1

* docs: small cleanup

* feat(github): include a devcontainer setup

* chore: improve type names

* feat(client): allow binary returns

* feat(client): support passing BaseModels to request params at runtime

* fix(binaries): don't synchronously block in astream_to_file

* 1.0.0-rc2

* chore(internal): remove unused int/float conversion

* docs(readme): improve example snippets

* fix: prevent TypeError in Python 3.8 (ABC is not subscriptable)

* 1.0.0-rc3

* docs: update streaming example

* docs(readme): update opening

* v1.0.0

---------

Co-authored-by: Robert Craigie <[email protected]>
Co-authored-by: Stainless Bot <[email protected]>
Co-authored-by: Stainless Bot <[email protected]>
Co-authored-by: Alex Rattray <[email protected]>
  • Loading branch information
5 people authored Nov 6, 2023
1 parent 284c179 commit 08b8179
Show file tree
Hide file tree
Showing 253 changed files with 21,668 additions and 8,629 deletions.
27 changes: 27 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# syntax=docker/dockerfile:1
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y \
libxkbcommon0 \
ca-certificates \
make \
curl \
git \
unzip \
libc++1 \
vim \
termcap \
&& apt-get clean autoclean

RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.15.2" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/root/.rye/shims:$PATH

WORKDIR /workspace

COPY README.md .python-version pyproject.toml requirements.lock requirements-dev.lock /workspace/

RUN rye sync --all-features

COPY . /workspace

CMD ["rye", "shell"]
20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Debian",
"build": {
"dockerfile": "Dockerfile"
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
56 changes: 0 additions & 56 deletions .github/ISSUE_TEMPLATE/bug_report.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
name: lint
runs-on: ubuntu-latest
if: github.repository == 'openai/openai-python'

steps:
- uses: actions/checkout@v3

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.15.2
RYE_INSTALL_OPTION: "--yes"

- name: Install dependencies
run: |
rye sync --all-features
- name: Run ruff
run: |
rye run check:ruff
- name: Run type checking
run: |
rye run typecheck
- name: Ensure importable
run: |
rye run python -c 'import openai'
24 changes: 13 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
*.egg-info
.idea
.python-version
/public/dist
.vscode
_dev

__pycache__
build
*.egg
.vscode/settings.json
.ipynb_checkpoints
.vscode/launch.json
examples/azure/training.jsonl
examples/azure/validation.jsonl
.mypy_cache

dist

.venv
.idea

.env
.envrc
codegen.log
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.18
1 change: 1 addition & 0 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configured_endpoints: 28
Loading

0 comments on commit 08b8179

Please sign in to comment.