diff --git a/README.md b/README.md index e65a6653fa..a740db06fe 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ [![PyPI version](https://img.shields.io/pypi/v/openai.svg)](https://pypi.org/project/openai/) -The OpenAI Python library provides access to the OpenAI REST API in Python applications. The library includes type definitions for all request params and response fields, offering clients for both synchronous and asynchronous operations powered by [httpx](https://github.com/encode/httpx). + + +The OpenAI Python library provides access to the OpenAI REST API in Python applications. It includes type definitions for all request params and response fields and has clients for both synchronous and asynchronous operations powered by [httpx](https://github.com/encode/httpx). The OpenAI Python library is generated from OpenAI's [OpenAPI specification](https://github.com/openai/openai-openapi) with [Stainless](https://stainlessapi.com/). @@ -11,31 +13,37 @@ The OpenAI Python library is generated from OpenAI's [OpenAPI specification](htt - [Python](https://www.python.org/) 3.7+ - [OpenAI API key](https://platform.openai.com/account/api-keys) -## Installation +## Install the package -You can install the [openai](https://pypi.org/project/openai/) package from PyPi with `pip`: +You can the [openai](https://pypi.org/project/openai/) package from PyPi with `pip`: ```sh # Install the package pip install openai ``` -### Migration +## Migrate from earlier versions + +Released on November 6th 2023, the OpenAI Python library was rewritten for version `1.0.0`. + +If your project used a pre-v1 version of the library, see the [v1 migration guide](https://github.com/openai/openai-python/discussions/742) for information and scripts that can help you update your code. + + -Released on November 6th 2023, the OpenAI Python library was rewritten for v1. If your project used a pre-v1 version of the library, see the [v1 migration guide](https://github.com/openai/openai-python/discussions/742) for information and scripts that can help you update your code. +## Connect -## Usage + To connect to the OpenAI API: -1. Populate an `OPENAI_API_KEY` environment variable with your [OpenAI API key](https://platform.openai.com/account/api-keys). +1. Populate an `OPENAI_API_KEY` environment variable with your [OpenAI API key](https://platform.openai.com/account/api-keys) 2. Create a synchronous or asynchronous `OpenAI` client object. -!!! Tip - To reduce the risk of committing your OpenAI API key to source control, we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/) and adding `OPENAI_API_KEY="YOUR_API_KEY_HERE"` to your `.env` file. +!!! Tip + To reduce the risk of committing your OpenAI API key to source control, you can use [python-dotenv](https://pypi.org/project/python-dotenv/) and add `OPENAI_API_KEY="YOUR_API_KEY_HERE"` to your `.env` file. -### Synchronous client +## Synchronous client Create an instance of the [OpenAI][src.openai.OpenAI] client: @@ -78,7 +86,7 @@ for chunk in stream: 1. :material-chat: This enables response streaming through Server Side Events (SSE). -### Asynchronous client +## Asynchronous client Create an instance of the [AsyncOpenAI][src.openai.AsyncOpenAI] client and `await` each API call. Functionality between the synchronous and asynchronous clients is otherwise identical. @@ -132,7 +140,7 @@ asyncio.run(main()) 1. :material-chat: This enables response streaming through Server Side Events (SSE). -### Module-level global client +## Module-level global client Similar to pre-v1 versions of the library, there is also a module-level client available for use in REPLs, notebooks, and other scenarios requiring quick "local loop" iteration. @@ -163,15 +171,18 @@ completion = openai.chat.completions.create( print(completion.choices[0].message.content) ``` -We recommend you *avoid* using this module-level client your application code because: +We recommend you _avoid_ using this module-level client your application code because: - It can be difficult to reason about where client options are configured. - It's impossible to change certain client options without causing the potential for race conditions. - It's harder to mock for testing purposes. - It's impossible to control cleanup of network connections. + ## Request types + + Nested **request** parameters are Python [TypedDicts][typing.TypedDict]. For example, the user message in the following [`chat.completions.create()`][src.openai.resources.chat.completions.Completions.create] request is a [`ChatCompletionUserMessageParam`][src.openai.types.chat.chat_completion_user_message_param.ChatCompletionUserMessageParam], which has a base type of [`TypedDict`][typing.TypedDict]: @@ -222,8 +233,12 @@ The async client uses the same interface. If you pass a [`PathLike`][os.PathLike Typed requests and responses enable type checking, autocompletion, and hover-help documentation in editors that support those features. In Visual Studio Code, for example, you can [enable type checking in Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) by setting `python.analysis.typeCheckingMode` to `basic` as described in that article's **Settings and Customization** section. + + ## Handling errors + + When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of [`openai.APIConnectionError`][src.openai.APIConnectionError] is raised. When the API returns a non-success status code (that is, 4xx or 5xx @@ -255,22 +270,23 @@ except openai.APIStatusError as e: Error codes are as followed: -| Status Code | Error Type | -| ----------- | -------------------------- | -| 400 | `BadRequestError` | -| 401 | `AuthenticationError` | -| 403 | `PermissionDeniedError` | -| 404 | `NotFoundError` | -| 422 | `UnprocessableEntityError` | -| 429 | `RateLimitError` | -| >=500 | `InternalServerError` | -| N/A | `APIConnectionError` | +| Status Code | Error Type | +| :---------: | ----------------------------------------------------------------- | +| 400 | [`BadRequestError`][src.openai.BadRequestError] | +| 401 | [`AuthenticationError`][src.openai.AuthenticationError] | +| 403 | [`PermissionDeniedError`][src.openai.PermissionDeniedError] | +| 404 | [`NotFoundError`][src.openai.NotFoundError] | +| 409 | [`ConflictError`][src.openai.ConflictError] | +| 422 | [`UnprocessableEntityError`][src.openai.UnprocessableEntityError] | +| 429 | [`RateLimitError`][src.openai.RateLimitError] | +| >=500 | [`InternalServerError`][src.openai.InternalServerError] | +| N/A | [`APIConnectionError`][src.openai.APIConnectionError] | -### Retries +## Retries Certain errors are automatically retried 2 times by default, with a short exponential backoff. -Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, -429 Rate Limit, and >=500 Internal errors are all retried by default. + +Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors are all retried by default. You can use the `max_retries` option to configure or disable retry settings: @@ -295,7 +311,7 @@ client.with_options(max_retries=5).chat.completions.create( ) ``` -### Timeouts +## Timeouts By default requests time out after 10 minutes. You can configure this with a `timeout` option, which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: @@ -330,10 +346,14 @@ On timeout, an `APITimeoutError` is thrown. Note that requests that time out are [retried twice by default](#retries). + + ## Advanced ### Logging + + We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module. You can enable logging by setting the environment variable `OPENAI_LOG` to `debug`. @@ -354,9 +374,9 @@ if response.my_field is None: print('Got json like {"my_field": null}.') ``` -### Accessing raw response data (e.g. headers) +### Accessing raw response data (headers) -The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g., +The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, for example: ```py from openai import OpenAI @@ -410,8 +430,12 @@ with client.chat.completions.with_streaming_response.create( The context manager is required so that the response will reliably be closed. + + ### Configuring the HTTP client + + You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including: - Support for proxies @@ -489,3 +513,5 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. We are keen for your feedback; please open an [issue](https://www.github.com/openai/openai-python/issues) with questions, bugs, or suggestions. + + diff --git a/docs/advanced.md b/docs/advanced.md new file mode 100644 index 0000000000..5a7b78c82d --- /dev/null +++ b/docs/advanced.md @@ -0,0 +1,3 @@ +# Advanced configuration + +--8<-- "./README.md:advanced" \ No newline at end of file diff --git a/docs/connect.md b/docs/connect.md new file mode 100644 index 0000000000..74e1632ffe --- /dev/null +++ b/docs/connect.md @@ -0,0 +1,3 @@ +# Connect + +--8<-- "./README.md:connect" \ No newline at end of file diff --git a/docs/debugging.md b/docs/debugging.md new file mode 100644 index 0000000000..64ba0a9c93 --- /dev/null +++ b/docs/debugging.md @@ -0,0 +1,3 @@ +# Logging and debugging + +--8<-- "./README.md:debugging" \ No newline at end of file diff --git a/docs/error-handling.md b/docs/error-handling.md new file mode 100644 index 0000000000..f201b5171f --- /dev/null +++ b/docs/error-handling.md @@ -0,0 +1,3 @@ +# Error handling + +--8<-- "./README.md:handle-errors" \ No newline at end of file diff --git a/docs/get_started.md b/docs/get_started.md index d7a679522c..fd73dfaa4e 100644 --- a/docs/get_started.md +++ b/docs/get_started.md @@ -1,7 +1,7 @@ -# Get started +# Install -!!! quote +??? Info - The following is a modified version of the [README.md](https://github.com/openai/openai-python/blob/main/README.md) file in the upstream repo. *—[Marsh](https://github.com/mmacy)* + The pages in this _Get started_ section are adapted from the sections in the [README.md](https://github.com/openai/openai-python/blob/main/README.md) in the upstream repository. ---8<-- "./README.md:2" \ No newline at end of file +--8<-- "./README.md:get-started" \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index ad7615b500..2ed3b5aa08 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,7 @@ Welcome to Marsh's totally unofficial and totally unsupported documentation for
- :material-clock-fast: [Get started with the library](./get_started.md) -- :fontawesome-brands-python: [OpenAI Python library reference](openai.md) +- :fontawesome-brands-python: [OpenAI Python library reference](reference/index.md)
## About these docs @@ -29,6 +29,4 @@ That said, I use these docs myself and thus intend to keep them (mostly) current 1. That means you might encounter inaccuracies or you might not find what you think should be here. In either case, you should refer to [openai/openai-python](https://github.com/openai/openai-python) as the source of truth. -!!! quote - - If these docs help you, yay! If they don't, don't use 'em. Enjoy! *—[Marsh](https://github.com/mmacy)* \ No newline at end of file +:material-hand-wave: *Enjoy!* —[Marsh](https://github.com/mmacy) \ No newline at end of file diff --git a/docs/openai.md b/docs/openai.md deleted file mode 100644 index 3f4cdba52b..0000000000 --- a/docs/openai.md +++ /dev/null @@ -1,69 +0,0 @@ -# openai - - - -[Clients](#clients) | [Errors](#errors) | [Module attributes](#module-attributes) | [Other types](#other-types) | [Functions](#functions) - -## Clients - -::: src.openai.OpenAI -::: src.openai.AsyncOpenAI - -## Errors - -::: src.openai.APIConnectionError -::: src.openai.APIError -::: src.openai.APIResponseValidationError -::: src.openai.APIStatusError -::: src.openai.APITimeoutError -::: src.openai.AuthenticationError -::: src.openai.BadRequestError -::: src.openai.ConflictError -::: src.openai.InternalServerError -::: src.openai.NotFoundError -::: src.openai.OpenAIError -::: src.openai.PermissionDeniedError -::: src.openai.RateLimitError -::: src.openai.UnprocessableEntityError - -## Module attributes - -::: src.openai.__title__ -::: src.openai.__version__ -::: src.openai.api_key -::: src.openai.api_type -::: src.openai.api_version -::: src.openai.azure_ad_token -::: src.openai.azure_ad_token_provider -::: src.openai.azure_endpoint -::: src.openai.base_url -::: src.openai.default_headers -::: src.openai.default_query -::: src.openai.http_client -::: src.openai.max_retries -::: src.openai.organization -::: src.openai.timeout -::: src.openai.NoneType -::: src.openai.AsyncClient -::: src.openai.Client -::: src.openai.ProxiesTypes -::: src.openai.Transport -::: src.openai.types - -## Other types - -::: src.openai.AsyncStream -::: src.openai.BaseModel -::: src.openai.RequestOptions -::: src.openai.Stream - -## Functions - -::: src.openai.file_from_path - - - \ No newline at end of file diff --git a/docs/pagination.md b/docs/pagination.md deleted file mode 100644 index f598471c07..0000000000 --- a/docs/pagination.md +++ /dev/null @@ -1,3 +0,0 @@ -# openai.pagination - -::: src.openai.pagination diff --git a/docs/reference/SUMMARY.md b/docs/reference/SUMMARY.md new file mode 100644 index 0000000000..0a7d277a23 --- /dev/null +++ b/docs/reference/SUMMARY.md @@ -0,0 +1,138 @@ +* [openai](index.md) + * [pagination](pagination.md) + * [resources](resources/index.md) + * [audio](resources/audio/index.md) + * [audio](resources/audio/audio.md) + * [speech](resources/audio/speech.md) + * [transcriptions](resources/audio/transcriptions.md) + * [translations](resources/audio/translations.md) + * [beta](resources/beta/index.md) + * [assistants](resources/beta/assistants/index.md) + * [assistants](resources/beta/assistants/assistants.md) + * [files](resources/beta/assistants/files.md) + * [beta](resources/beta/beta.md) + * [threads](resources/beta/threads/index.md) + * [messages](resources/beta/threads/messages/index.md) + * [files](resources/beta/threads/messages/files.md) + * [messages](resources/beta/threads/messages/messages.md) + * [runs](resources/beta/threads/runs/index.md) + * [runs](resources/beta/threads/runs/runs.md) + * [steps](resources/beta/threads/runs/steps.md) + * [threads](resources/beta/threads/threads.md) + * [chat](resources/chat/index.md) + * [chat](resources/chat/chat.md) + * [completions](resources/chat/completions.md) + * [completions](resources/completions.md) + * [embeddings](resources/embeddings.md) + * [files](resources/files.md) + * [fine_tuning](resources/fine_tuning/index.md) + * [fine_tuning](resources/fine_tuning/fine_tuning.md) + * [jobs](resources/fine_tuning/jobs.md) + * [images](resources/images.md) + * [models](resources/models.md) + * [moderations](resources/moderations.md) + * [types](types/index.md) + * [audio](types/audio/index.md) + * [speech_create_params](types/audio/speech_create_params.md) + * [transcription](types/audio/transcription.md) + * [transcription_create_params](types/audio/transcription_create_params.md) + * [translation](types/audio/translation.md) + * [translation_create_params](types/audio/translation_create_params.md) + * [beta](types/beta/index.md) + * [assistant](types/beta/assistant.md) + * [assistant_create_params](types/beta/assistant_create_params.md) + * [assistant_deleted](types/beta/assistant_deleted.md) + * [assistant_list_params](types/beta/assistant_list_params.md) + * [assistant_update_params](types/beta/assistant_update_params.md) + * [assistants](types/beta/assistants/index.md) + * [assistant_file](types/beta/assistants/assistant_file.md) + * [file_create_params](types/beta/assistants/file_create_params.md) + * [file_delete_response](types/beta/assistants/file_delete_response.md) + * [file_list_params](types/beta/assistants/file_list_params.md) + * [chat](types/beta/chat/index.md) + * [thread](types/beta/thread.md) + * [thread_create_and_run_params](types/beta/thread_create_and_run_params.md) + * [thread_create_params](types/beta/thread_create_params.md) + * [thread_deleted](types/beta/thread_deleted.md) + * [thread_update_params](types/beta/thread_update_params.md) + * [threads](types/beta/threads/index.md) + * [message_content_image_file](types/beta/threads/message_content_image_file.md) + * [message_content_text](types/beta/threads/message_content_text.md) + * [message_create_params](types/beta/threads/message_create_params.md) + * [message_list_params](types/beta/threads/message_list_params.md) + * [message_update_params](types/beta/threads/message_update_params.md) + * [messages](types/beta/threads/messages/index.md) + * [file_list_params](types/beta/threads/messages/file_list_params.md) + * [message_file](types/beta/threads/messages/message_file.md) + * [required_action_function_tool_call](types/beta/threads/required_action_function_tool_call.md) + * [run](types/beta/threads/run.md) + * [run_create_params](types/beta/threads/run_create_params.md) + * [run_list_params](types/beta/threads/run_list_params.md) + * [run_submit_tool_outputs_params](types/beta/threads/run_submit_tool_outputs_params.md) + * [run_update_params](types/beta/threads/run_update_params.md) + * [runs](types/beta/threads/runs/index.md) + * [code_tool_call](types/beta/threads/runs/code_tool_call.md) + * [function_tool_call](types/beta/threads/runs/function_tool_call.md) + * [message_creation_step_details](types/beta/threads/runs/message_creation_step_details.md) + * [retrieval_tool_call](types/beta/threads/runs/retrieval_tool_call.md) + * [run_step](types/beta/threads/runs/run_step.md) + * [step_list_params](types/beta/threads/runs/step_list_params.md) + * [tool_calls_step_details](types/beta/threads/runs/tool_calls_step_details.md) + * [thread_message](types/beta/threads/thread_message.md) + * [chat](types/chat/index.md) + * [chat_completion](types/chat/chat_completion.md) + * [chat_completion_assistant_message_param](types/chat/chat_completion_assistant_message_param.md) + * [chat_completion_chunk](types/chat/chat_completion_chunk.md) + * [chat_completion_content_part_image_param](types/chat/chat_completion_content_part_image_param.md) + * [chat_completion_content_part_param](types/chat/chat_completion_content_part_param.md) + * [chat_completion_content_part_text_param](types/chat/chat_completion_content_part_text_param.md) + * [chat_completion_function_call_option_param](types/chat/chat_completion_function_call_option_param.md) + * [chat_completion_function_message_param](types/chat/chat_completion_function_message_param.md) + * [chat_completion_message](types/chat/chat_completion_message.md) + * [chat_completion_message_param](types/chat/chat_completion_message_param.md) + * [chat_completion_message_tool_call](types/chat/chat_completion_message_tool_call.md) + * [chat_completion_message_tool_call_param](types/chat/chat_completion_message_tool_call_param.md) + * [chat_completion_named_tool_choice_param](types/chat/chat_completion_named_tool_choice_param.md) + * [chat_completion_role](types/chat/chat_completion_role.md) + * [chat_completion_system_message_param](types/chat/chat_completion_system_message_param.md) + * [chat_completion_token_logprob](types/chat/chat_completion_token_logprob.md) + * [chat_completion_tool_choice_option_param](types/chat/chat_completion_tool_choice_option_param.md) + * [chat_completion_tool_message_param](types/chat/chat_completion_tool_message_param.md) + * [chat_completion_tool_param](types/chat/chat_completion_tool_param.md) + * [chat_completion_user_message_param](types/chat/chat_completion_user_message_param.md) + * [completion_create_params](types/chat/completion_create_params.md) + * [completion](types/completion.md) + * [completion_choice](types/completion_choice.md) + * [completion_create_params](types/completion_create_params.md) + * [completion_usage](types/completion_usage.md) + * [create_embedding_response](types/create_embedding_response.md) + * [embedding](types/embedding.md) + * [embedding_create_params](types/embedding_create_params.md) + * [file_content](types/file_content.md) + * [file_create_params](types/file_create_params.md) + * [file_deleted](types/file_deleted.md) + * [file_list_params](types/file_list_params.md) + * [file_object](types/file_object.md) + * [fine_tuning](types/fine_tuning/index.md) + * [fine_tuning_job](types/fine_tuning/fine_tuning_job.md) + * [fine_tuning_job_event](types/fine_tuning/fine_tuning_job_event.md) + * [job_create_params](types/fine_tuning/job_create_params.md) + * [job_list_events_params](types/fine_tuning/job_list_events_params.md) + * [job_list_params](types/fine_tuning/job_list_params.md) + * [image](types/image.md) + * [image_create_variation_params](types/image_create_variation_params.md) + * [image_edit_params](types/image_edit_params.md) + * [image_generate_params](types/image_generate_params.md) + * [images_response](types/images_response.md) + * [model](types/model.md) + * [model_deleted](types/model_deleted.md) + * [moderation](types/moderation.md) + * [moderation_create_params](types/moderation_create_params.md) + * [moderation_create_response](types/moderation_create_response.md) + * [shared](types/shared/index.md) + * [function_definition](types/shared/function_definition.md) + * [function_parameters](types/shared/function_parameters.md) + * [shared_params](types/shared_params/index.md) + * [function_definition](types/shared_params/function_definition.md) + * [function_parameters](types/shared_params/function_parameters.md) + * [version](version.md) diff --git a/docs/reference/_extras/index.md b/docs/reference/_extras/index.md new file mode 100644 index 0000000000..5799f72f79 --- /dev/null +++ b/docs/reference/_extras/index.md @@ -0,0 +1 @@ +::: src.openai._extras \ No newline at end of file diff --git a/docs/reference/_extras/numpy_proxy.md b/docs/reference/_extras/numpy_proxy.md new file mode 100644 index 0000000000..535ada77ef --- /dev/null +++ b/docs/reference/_extras/numpy_proxy.md @@ -0,0 +1 @@ +::: src.openai._extras.numpy_proxy \ No newline at end of file diff --git a/docs/reference/_extras/pandas_proxy.md b/docs/reference/_extras/pandas_proxy.md new file mode 100644 index 0000000000..1af3a0bbab --- /dev/null +++ b/docs/reference/_extras/pandas_proxy.md @@ -0,0 +1 @@ +::: src.openai._extras.pandas_proxy \ No newline at end of file diff --git a/docs/reference/_utils/index.md b/docs/reference/_utils/index.md new file mode 100644 index 0000000000..2e30a2f85c --- /dev/null +++ b/docs/reference/_utils/index.md @@ -0,0 +1 @@ +::: src.openai._utils \ No newline at end of file diff --git a/docs/reference/cli/_api/audio.md b/docs/reference/cli/_api/audio.md new file mode 100644 index 0000000000..948b912f3b --- /dev/null +++ b/docs/reference/cli/_api/audio.md @@ -0,0 +1 @@ +::: src.openai.cli._api.audio \ No newline at end of file diff --git a/docs/reference/cli/_api/chat/completions.md b/docs/reference/cli/_api/chat/completions.md new file mode 100644 index 0000000000..3d826db248 --- /dev/null +++ b/docs/reference/cli/_api/chat/completions.md @@ -0,0 +1 @@ +::: src.openai.cli._api.chat.completions \ No newline at end of file diff --git a/docs/reference/cli/_api/chat/index.md b/docs/reference/cli/_api/chat/index.md new file mode 100644 index 0000000000..4f98cad735 --- /dev/null +++ b/docs/reference/cli/_api/chat/index.md @@ -0,0 +1 @@ +::: src.openai.cli._api.chat \ No newline at end of file diff --git a/docs/reference/cli/_api/completions.md b/docs/reference/cli/_api/completions.md new file mode 100644 index 0000000000..aa0447367e --- /dev/null +++ b/docs/reference/cli/_api/completions.md @@ -0,0 +1 @@ +::: src.openai.cli._api.completions \ No newline at end of file diff --git a/docs/reference/cli/_api/files.md b/docs/reference/cli/_api/files.md new file mode 100644 index 0000000000..30b953388a --- /dev/null +++ b/docs/reference/cli/_api/files.md @@ -0,0 +1 @@ +::: src.openai.cli._api.files \ No newline at end of file diff --git a/docs/reference/cli/_api/image.md b/docs/reference/cli/_api/image.md new file mode 100644 index 0000000000..742a995147 --- /dev/null +++ b/docs/reference/cli/_api/image.md @@ -0,0 +1 @@ +::: src.openai.cli._api.image \ No newline at end of file diff --git a/docs/reference/cli/_api/index.md b/docs/reference/cli/_api/index.md new file mode 100644 index 0000000000..7f69f5feb1 --- /dev/null +++ b/docs/reference/cli/_api/index.md @@ -0,0 +1 @@ +::: src.openai.cli._api \ No newline at end of file diff --git a/docs/reference/cli/_api/models.md b/docs/reference/cli/_api/models.md new file mode 100644 index 0000000000..3cf6b2fa91 --- /dev/null +++ b/docs/reference/cli/_api/models.md @@ -0,0 +1 @@ +::: src.openai.cli._api.models \ No newline at end of file diff --git a/docs/reference/cli/_tools/fine_tunes.md b/docs/reference/cli/_tools/fine_tunes.md new file mode 100644 index 0000000000..786623160a --- /dev/null +++ b/docs/reference/cli/_tools/fine_tunes.md @@ -0,0 +1 @@ +::: src.openai.cli._tools.fine_tunes \ No newline at end of file diff --git a/docs/reference/cli/_tools/index.md b/docs/reference/cli/_tools/index.md new file mode 100644 index 0000000000..82cf4a0e9f --- /dev/null +++ b/docs/reference/cli/_tools/index.md @@ -0,0 +1 @@ +::: src.openai.cli._tools \ No newline at end of file diff --git a/docs/reference/cli/_tools/migrate.md b/docs/reference/cli/_tools/migrate.md new file mode 100644 index 0000000000..72a52abcb1 --- /dev/null +++ b/docs/reference/cli/_tools/migrate.md @@ -0,0 +1 @@ +::: src.openai.cli._tools.migrate \ No newline at end of file diff --git a/docs/reference/cli/index.md b/docs/reference/cli/index.md new file mode 100644 index 0000000000..bc12e75cd8 --- /dev/null +++ b/docs/reference/cli/index.md @@ -0,0 +1 @@ +::: src.openai.cli \ No newline at end of file diff --git a/docs/reference/index.md b/docs/reference/index.md new file mode 100644 index 0000000000..2b37911c53 --- /dev/null +++ b/docs/reference/index.md @@ -0,0 +1,3 @@ +# openai + +::: src.openai \ No newline at end of file diff --git a/docs/reference/lib/azure.md b/docs/reference/lib/azure.md new file mode 100644 index 0000000000..4b2a3b2947 --- /dev/null +++ b/docs/reference/lib/azure.md @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/reference/pagination.md b/docs/reference/pagination.md new file mode 100644 index 0000000000..1a202ec400 --- /dev/null +++ b/docs/reference/pagination.md @@ -0,0 +1 @@ +::: src.openai.pagination \ No newline at end of file diff --git a/docs/reference/resources/audio/audio.md b/docs/reference/resources/audio/audio.md new file mode 100644 index 0000000000..644f43ed9c --- /dev/null +++ b/docs/reference/resources/audio/audio.md @@ -0,0 +1 @@ +::: src.openai.resources.audio.audio \ No newline at end of file diff --git a/docs/reference/resources/audio/index.md b/docs/reference/resources/audio/index.md new file mode 100644 index 0000000000..b833099d5f --- /dev/null +++ b/docs/reference/resources/audio/index.md @@ -0,0 +1,3 @@ +# openai.resources.audio + +::: src.openai.resources.audio \ No newline at end of file diff --git a/docs/reference/resources/audio/speech.md b/docs/reference/resources/audio/speech.md new file mode 100644 index 0000000000..c5804e5476 --- /dev/null +++ b/docs/reference/resources/audio/speech.md @@ -0,0 +1 @@ +::: src.openai.resources.audio.speech \ No newline at end of file diff --git a/docs/reference/resources/audio/transcriptions.md b/docs/reference/resources/audio/transcriptions.md new file mode 100644 index 0000000000..2659764d51 --- /dev/null +++ b/docs/reference/resources/audio/transcriptions.md @@ -0,0 +1 @@ +::: src.openai.resources.audio.transcriptions \ No newline at end of file diff --git a/docs/reference/resources/audio/translations.md b/docs/reference/resources/audio/translations.md new file mode 100644 index 0000000000..0de690da7e --- /dev/null +++ b/docs/reference/resources/audio/translations.md @@ -0,0 +1 @@ +::: src.openai.resources.audio.translations \ No newline at end of file diff --git a/docs/reference/resources/beta/assistants/assistants.md b/docs/reference/resources/beta/assistants/assistants.md new file mode 100644 index 0000000000..88558bf5fd --- /dev/null +++ b/docs/reference/resources/beta/assistants/assistants.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.assistants.assistants \ No newline at end of file diff --git a/docs/reference/resources/beta/assistants/files.md b/docs/reference/resources/beta/assistants/files.md new file mode 100644 index 0000000000..c0899e4a8d --- /dev/null +++ b/docs/reference/resources/beta/assistants/files.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.assistants.files \ No newline at end of file diff --git a/docs/reference/resources/beta/assistants/index.md b/docs/reference/resources/beta/assistants/index.md new file mode 100644 index 0000000000..234f0822c0 --- /dev/null +++ b/docs/reference/resources/beta/assistants/index.md @@ -0,0 +1,3 @@ +# openai.resources.beta.assistants + +::: src.openai.resources.beta.assistants \ No newline at end of file diff --git a/docs/reference/resources/beta/beta.md b/docs/reference/resources/beta/beta.md new file mode 100644 index 0000000000..8ded45c8a8 --- /dev/null +++ b/docs/reference/resources/beta/beta.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.beta \ No newline at end of file diff --git a/docs/reference/resources/beta/index.md b/docs/reference/resources/beta/index.md new file mode 100644 index 0000000000..85e21ed369 --- /dev/null +++ b/docs/reference/resources/beta/index.md @@ -0,0 +1,3 @@ +# openai.resources.beta + +::: src.openai.resources.beta \ No newline at end of file diff --git a/docs/reference/resources/beta/threads/index.md b/docs/reference/resources/beta/threads/index.md new file mode 100644 index 0000000000..5c040f9763 --- /dev/null +++ b/docs/reference/resources/beta/threads/index.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.threads \ No newline at end of file diff --git a/docs/reference/resources/beta/threads/messages/files.md b/docs/reference/resources/beta/threads/messages/files.md new file mode 100644 index 0000000000..314d37f38e --- /dev/null +++ b/docs/reference/resources/beta/threads/messages/files.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.threads.messages.files \ No newline at end of file diff --git a/docs/reference/resources/beta/threads/messages/index.md b/docs/reference/resources/beta/threads/messages/index.md new file mode 100644 index 0000000000..148ba62544 --- /dev/null +++ b/docs/reference/resources/beta/threads/messages/index.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.threads.messages \ No newline at end of file diff --git a/docs/resources/audio/speech.md b/docs/reference/resources/beta/threads/messages/messages.md similarity index 69% rename from docs/resources/audio/speech.md rename to docs/reference/resources/beta/threads/messages/messages.md index a64551ad90..365ff4c3fd 100644 --- a/docs/resources/audio/speech.md +++ b/docs/reference/resources/beta/threads/messages/messages.md @@ -1 +1 @@ -::: src.openai.resources.audio.speech +::: src.openai.resources.beta.threads.messages.messages \ No newline at end of file diff --git a/docs/reference/resources/beta/threads/runs/index.md b/docs/reference/resources/beta/threads/runs/index.md new file mode 100644 index 0000000000..258ccfacc3 --- /dev/null +++ b/docs/reference/resources/beta/threads/runs/index.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.threads.runs \ No newline at end of file diff --git a/docs/reference/resources/beta/threads/runs/runs.md b/docs/reference/resources/beta/threads/runs/runs.md new file mode 100644 index 0000000000..a7b0f06cc0 --- /dev/null +++ b/docs/reference/resources/beta/threads/runs/runs.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.threads.runs.runs \ No newline at end of file diff --git a/docs/reference/resources/beta/threads/runs/steps.md b/docs/reference/resources/beta/threads/runs/steps.md new file mode 100644 index 0000000000..969437ab7d --- /dev/null +++ b/docs/reference/resources/beta/threads/runs/steps.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.threads.runs.steps \ No newline at end of file diff --git a/docs/reference/resources/beta/threads/threads.md b/docs/reference/resources/beta/threads/threads.md new file mode 100644 index 0000000000..ed7aa2d8df --- /dev/null +++ b/docs/reference/resources/beta/threads/threads.md @@ -0,0 +1 @@ +::: src.openai.resources.beta.threads.threads \ No newline at end of file diff --git a/docs/reference/resources/chat/chat.md b/docs/reference/resources/chat/chat.md new file mode 100644 index 0000000000..04c8162991 --- /dev/null +++ b/docs/reference/resources/chat/chat.md @@ -0,0 +1 @@ +::: src.openai.resources.chat.chat \ No newline at end of file diff --git a/docs/reference/resources/chat/completions.md b/docs/reference/resources/chat/completions.md new file mode 100644 index 0000000000..fa018698d6 --- /dev/null +++ b/docs/reference/resources/chat/completions.md @@ -0,0 +1,3 @@ +::: src.openai.resources.chat.completions + options: + docstring_section_style: spacy \ No newline at end of file diff --git a/docs/reference/resources/chat/index.md b/docs/reference/resources/chat/index.md new file mode 100644 index 0000000000..3b07040ec7 --- /dev/null +++ b/docs/reference/resources/chat/index.md @@ -0,0 +1,3 @@ +# openai.resources.chat + +::: src.openai.resources.chat \ No newline at end of file diff --git a/docs/resources/completions.md b/docs/reference/resources/completions.md similarity index 100% rename from docs/resources/completions.md rename to docs/reference/resources/completions.md diff --git a/docs/reference/resources/embeddings.md b/docs/reference/resources/embeddings.md new file mode 100644 index 0000000000..6efa714f0c --- /dev/null +++ b/docs/reference/resources/embeddings.md @@ -0,0 +1 @@ +::: src.openai.resources.embeddings \ No newline at end of file diff --git a/docs/reference/resources/files.md b/docs/reference/resources/files.md new file mode 100644 index 0000000000..e1da9e1f22 --- /dev/null +++ b/docs/reference/resources/files.md @@ -0,0 +1 @@ +::: src.openai.resources.files \ No newline at end of file diff --git a/docs/reference/resources/fine_tuning/fine_tuning.md b/docs/reference/resources/fine_tuning/fine_tuning.md new file mode 100644 index 0000000000..b480bb4f48 --- /dev/null +++ b/docs/reference/resources/fine_tuning/fine_tuning.md @@ -0,0 +1 @@ +::: src.openai.resources.fine_tuning.fine_tuning \ No newline at end of file diff --git a/docs/reference/resources/fine_tuning/index.md b/docs/reference/resources/fine_tuning/index.md new file mode 100644 index 0000000000..2251574768 --- /dev/null +++ b/docs/reference/resources/fine_tuning/index.md @@ -0,0 +1,3 @@ +# openai.resources.fine_tuning + +::: src.openai.resources.fine_tuning \ No newline at end of file diff --git a/docs/reference/resources/fine_tuning/jobs.md b/docs/reference/resources/fine_tuning/jobs.md new file mode 100644 index 0000000000..b52972dcb5 --- /dev/null +++ b/docs/reference/resources/fine_tuning/jobs.md @@ -0,0 +1 @@ +::: src.openai.resources.fine_tuning.jobs \ No newline at end of file diff --git a/docs/reference/resources/images.md b/docs/reference/resources/images.md new file mode 100644 index 0000000000..cc444a3a26 --- /dev/null +++ b/docs/reference/resources/images.md @@ -0,0 +1 @@ +::: src.openai.resources.images \ No newline at end of file diff --git a/docs/resources/index.md b/docs/reference/resources/index.md similarity index 100% rename from docs/resources/index.md rename to docs/reference/resources/index.md diff --git a/docs/reference/resources/models.md b/docs/reference/resources/models.md new file mode 100644 index 0000000000..74bbfd7a5f --- /dev/null +++ b/docs/reference/resources/models.md @@ -0,0 +1 @@ +::: src.openai.resources.models \ No newline at end of file diff --git a/docs/reference/resources/moderations.md b/docs/reference/resources/moderations.md new file mode 100644 index 0000000000..097c9dee96 --- /dev/null +++ b/docs/reference/resources/moderations.md @@ -0,0 +1 @@ +::: src.openai.resources.moderations \ No newline at end of file diff --git a/docs/reference/types/audio/index.md b/docs/reference/types/audio/index.md new file mode 100644 index 0000000000..4917bcea68 --- /dev/null +++ b/docs/reference/types/audio/index.md @@ -0,0 +1,3 @@ +# openai.types.audio + +::: src.openai.types.audio \ No newline at end of file diff --git a/docs/reference/types/audio/speech_create_params.md b/docs/reference/types/audio/speech_create_params.md new file mode 100644 index 0000000000..e96c1ab472 --- /dev/null +++ b/docs/reference/types/audio/speech_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.audio.speech_create_params \ No newline at end of file diff --git a/docs/reference/types/audio/transcription.md b/docs/reference/types/audio/transcription.md new file mode 100644 index 0000000000..883b478372 --- /dev/null +++ b/docs/reference/types/audio/transcription.md @@ -0,0 +1 @@ +::: src.openai.types.audio.transcription \ No newline at end of file diff --git a/docs/reference/types/audio/transcription_create_params.md b/docs/reference/types/audio/transcription_create_params.md new file mode 100644 index 0000000000..7839e0d9b1 --- /dev/null +++ b/docs/reference/types/audio/transcription_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.audio.transcription_create_params \ No newline at end of file diff --git a/docs/reference/types/audio/translation.md b/docs/reference/types/audio/translation.md new file mode 100644 index 0000000000..6556f0deb8 --- /dev/null +++ b/docs/reference/types/audio/translation.md @@ -0,0 +1 @@ +::: src.openai.types.audio.translation \ No newline at end of file diff --git a/docs/reference/types/audio/translation_create_params.md b/docs/reference/types/audio/translation_create_params.md new file mode 100644 index 0000000000..b215c8bc54 --- /dev/null +++ b/docs/reference/types/audio/translation_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.audio.translation_create_params \ No newline at end of file diff --git a/docs/reference/types/beta/assistant.md b/docs/reference/types/beta/assistant.md new file mode 100644 index 0000000000..019097af04 --- /dev/null +++ b/docs/reference/types/beta/assistant.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistant \ No newline at end of file diff --git a/docs/reference/types/beta/assistant_create_params.md b/docs/reference/types/beta/assistant_create_params.md new file mode 100644 index 0000000000..1b660f8c16 --- /dev/null +++ b/docs/reference/types/beta/assistant_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistant_create_params \ No newline at end of file diff --git a/docs/reference/types/beta/assistant_deleted.md b/docs/reference/types/beta/assistant_deleted.md new file mode 100644 index 0000000000..99e7c5e232 --- /dev/null +++ b/docs/reference/types/beta/assistant_deleted.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistant_deleted \ No newline at end of file diff --git a/docs/reference/types/beta/assistant_list_params.md b/docs/reference/types/beta/assistant_list_params.md new file mode 100644 index 0000000000..b3b2eb3622 --- /dev/null +++ b/docs/reference/types/beta/assistant_list_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistant_list_params \ No newline at end of file diff --git a/docs/reference/types/beta/assistant_update_params.md b/docs/reference/types/beta/assistant_update_params.md new file mode 100644 index 0000000000..2b85bd14c1 --- /dev/null +++ b/docs/reference/types/beta/assistant_update_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistant_update_params \ No newline at end of file diff --git a/docs/reference/types/beta/assistants/assistant_file.md b/docs/reference/types/beta/assistants/assistant_file.md new file mode 100644 index 0000000000..ac12de06d3 --- /dev/null +++ b/docs/reference/types/beta/assistants/assistant_file.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistants.assistant_file \ No newline at end of file diff --git a/docs/reference/types/beta/assistants/file_create_params.md b/docs/reference/types/beta/assistants/file_create_params.md new file mode 100644 index 0000000000..1beb8fb6ed --- /dev/null +++ b/docs/reference/types/beta/assistants/file_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistants.file_create_params \ No newline at end of file diff --git a/docs/reference/types/beta/assistants/file_delete_response.md b/docs/reference/types/beta/assistants/file_delete_response.md new file mode 100644 index 0000000000..72e39683dd --- /dev/null +++ b/docs/reference/types/beta/assistants/file_delete_response.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistants.file_delete_response \ No newline at end of file diff --git a/docs/reference/types/beta/assistants/file_list_params.md b/docs/reference/types/beta/assistants/file_list_params.md new file mode 100644 index 0000000000..b5266ff732 --- /dev/null +++ b/docs/reference/types/beta/assistants/file_list_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistants.file_list_params \ No newline at end of file diff --git a/docs/reference/types/beta/assistants/index.md b/docs/reference/types/beta/assistants/index.md new file mode 100644 index 0000000000..8835c0eea5 --- /dev/null +++ b/docs/reference/types/beta/assistants/index.md @@ -0,0 +1 @@ +::: src.openai.types.beta.assistants \ No newline at end of file diff --git a/docs/reference/types/beta/chat/index.md b/docs/reference/types/beta/chat/index.md new file mode 100644 index 0000000000..d91d7e90f0 --- /dev/null +++ b/docs/reference/types/beta/chat/index.md @@ -0,0 +1 @@ +::: src.openai.types.beta.chat \ No newline at end of file diff --git a/docs/reference/types/beta/index.md b/docs/reference/types/beta/index.md new file mode 100644 index 0000000000..23c8b493c5 --- /dev/null +++ b/docs/reference/types/beta/index.md @@ -0,0 +1,3 @@ +# src.openai.types.beta + +::: src.openai.types.beta \ No newline at end of file diff --git a/docs/reference/types/beta/thread.md b/docs/reference/types/beta/thread.md new file mode 100644 index 0000000000..95c7baa196 --- /dev/null +++ b/docs/reference/types/beta/thread.md @@ -0,0 +1 @@ +::: src.openai.types.beta.thread \ No newline at end of file diff --git a/docs/reference/types/beta/thread_create_and_run_params.md b/docs/reference/types/beta/thread_create_and_run_params.md new file mode 100644 index 0000000000..518dbdab7e --- /dev/null +++ b/docs/reference/types/beta/thread_create_and_run_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.thread_create_and_run_params \ No newline at end of file diff --git a/docs/reference/types/beta/thread_create_params.md b/docs/reference/types/beta/thread_create_params.md new file mode 100644 index 0000000000..2bfa51c217 --- /dev/null +++ b/docs/reference/types/beta/thread_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.thread_create_params \ No newline at end of file diff --git a/docs/reference/types/beta/thread_deleted.md b/docs/reference/types/beta/thread_deleted.md new file mode 100644 index 0000000000..4e1aaae618 --- /dev/null +++ b/docs/reference/types/beta/thread_deleted.md @@ -0,0 +1 @@ +::: src.openai.types.beta.thread_deleted \ No newline at end of file diff --git a/docs/reference/types/beta/thread_update_params.md b/docs/reference/types/beta/thread_update_params.md new file mode 100644 index 0000000000..cdb9c64e2d --- /dev/null +++ b/docs/reference/types/beta/thread_update_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.thread_update_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/index.md b/docs/reference/types/beta/threads/index.md new file mode 100644 index 0000000000..d2a3ee7349 --- /dev/null +++ b/docs/reference/types/beta/threads/index.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads \ No newline at end of file diff --git a/docs/reference/types/beta/threads/message_content_image_file.md b/docs/reference/types/beta/threads/message_content_image_file.md new file mode 100644 index 0000000000..512819ffbd --- /dev/null +++ b/docs/reference/types/beta/threads/message_content_image_file.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.message_content_image_file \ No newline at end of file diff --git a/docs/reference/types/beta/threads/message_content_text.md b/docs/reference/types/beta/threads/message_content_text.md new file mode 100644 index 0000000000..f938d4fcc2 --- /dev/null +++ b/docs/reference/types/beta/threads/message_content_text.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.message_content_text \ No newline at end of file diff --git a/docs/reference/types/beta/threads/message_create_params.md b/docs/reference/types/beta/threads/message_create_params.md new file mode 100644 index 0000000000..80be727b3c --- /dev/null +++ b/docs/reference/types/beta/threads/message_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.message_create_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/message_list_params.md b/docs/reference/types/beta/threads/message_list_params.md new file mode 100644 index 0000000000..1437e530f4 --- /dev/null +++ b/docs/reference/types/beta/threads/message_list_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.message_list_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/message_update_params.md b/docs/reference/types/beta/threads/message_update_params.md new file mode 100644 index 0000000000..f3a7e1a558 --- /dev/null +++ b/docs/reference/types/beta/threads/message_update_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.message_update_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/messages/file_list_params.md b/docs/reference/types/beta/threads/messages/file_list_params.md new file mode 100644 index 0000000000..b716a84769 --- /dev/null +++ b/docs/reference/types/beta/threads/messages/file_list_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.messages.file_list_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/messages/index.md b/docs/reference/types/beta/threads/messages/index.md new file mode 100644 index 0000000000..dbd49ccda6 --- /dev/null +++ b/docs/reference/types/beta/threads/messages/index.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.messages \ No newline at end of file diff --git a/docs/reference/types/beta/threads/messages/message_file.md b/docs/reference/types/beta/threads/messages/message_file.md new file mode 100644 index 0000000000..34e11d69b6 --- /dev/null +++ b/docs/reference/types/beta/threads/messages/message_file.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.messages.message_file \ No newline at end of file diff --git a/docs/types/beta/threads/required_action_function_tool_call.md b/docs/reference/types/beta/threads/required_action_function_tool_call.md similarity index 92% rename from docs/types/beta/threads/required_action_function_tool_call.md rename to docs/reference/types/beta/threads/required_action_function_tool_call.md index 94735fcd65..7fc373a6b2 100644 --- a/docs/types/beta/threads/required_action_function_tool_call.md +++ b/docs/reference/types/beta/threads/required_action_function_tool_call.md @@ -1 +1 @@ -::: src.openai.types.beta.threads.required_action_function_tool_call +::: src.openai.types.beta.threads.required_action_function_tool_call \ No newline at end of file diff --git a/docs/reference/types/beta/threads/run.md b/docs/reference/types/beta/threads/run.md new file mode 100644 index 0000000000..d74611acc2 --- /dev/null +++ b/docs/reference/types/beta/threads/run.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.run \ No newline at end of file diff --git a/docs/reference/types/beta/threads/run_create_params.md b/docs/reference/types/beta/threads/run_create_params.md new file mode 100644 index 0000000000..c3fe01d75c --- /dev/null +++ b/docs/reference/types/beta/threads/run_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.run_create_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/run_list_params.md b/docs/reference/types/beta/threads/run_list_params.md new file mode 100644 index 0000000000..691a13df0f --- /dev/null +++ b/docs/reference/types/beta/threads/run_list_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.run_list_params \ No newline at end of file diff --git a/docs/types/beta/threads/run_submit_tool_outputs_params.md b/docs/reference/types/beta/threads/run_submit_tool_outputs_params.md similarity index 98% rename from docs/types/beta/threads/run_submit_tool_outputs_params.md rename to docs/reference/types/beta/threads/run_submit_tool_outputs_params.md index dd0a16bba8..e002ecd57a 100644 --- a/docs/types/beta/threads/run_submit_tool_outputs_params.md +++ b/docs/reference/types/beta/threads/run_submit_tool_outputs_params.md @@ -1 +1 @@ -::: src.openai.types.beta.threads.run_submit_tool_outputs_params +::: src.openai.types.beta.threads.run_submit_tool_outputs_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/run_update_params.md b/docs/reference/types/beta/threads/run_update_params.md new file mode 100644 index 0000000000..70b9197a80 --- /dev/null +++ b/docs/reference/types/beta/threads/run_update_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.run_update_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/runs/code_tool_call.md b/docs/reference/types/beta/threads/runs/code_tool_call.md new file mode 100644 index 0000000000..4a27d83c16 --- /dev/null +++ b/docs/reference/types/beta/threads/runs/code_tool_call.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.runs.code_tool_call \ No newline at end of file diff --git a/docs/reference/types/beta/threads/runs/function_tool_call.md b/docs/reference/types/beta/threads/runs/function_tool_call.md new file mode 100644 index 0000000000..09bd391368 --- /dev/null +++ b/docs/reference/types/beta/threads/runs/function_tool_call.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.runs.function_tool_call \ No newline at end of file diff --git a/docs/reference/types/beta/threads/runs/index.md b/docs/reference/types/beta/threads/runs/index.md new file mode 100644 index 0000000000..c38bb9c406 --- /dev/null +++ b/docs/reference/types/beta/threads/runs/index.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.runs \ No newline at end of file diff --git a/docs/types/beta/threads/runs/message_creation_step_details.md b/docs/reference/types/beta/threads/runs/message_creation_step_details.md similarity index 92% rename from docs/types/beta/threads/runs/message_creation_step_details.md rename to docs/reference/types/beta/threads/runs/message_creation_step_details.md index deaa67587a..16eecb6e64 100644 --- a/docs/types/beta/threads/runs/message_creation_step_details.md +++ b/docs/reference/types/beta/threads/runs/message_creation_step_details.md @@ -1 +1 @@ -::: src.openai.types.beta.threads.runs.message_creation_step_details +::: src.openai.types.beta.threads.runs.message_creation_step_details \ No newline at end of file diff --git a/docs/reference/types/beta/threads/runs/retrieval_tool_call.md b/docs/reference/types/beta/threads/runs/retrieval_tool_call.md new file mode 100644 index 0000000000..a5dbdc8690 --- /dev/null +++ b/docs/reference/types/beta/threads/runs/retrieval_tool_call.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.runs.retrieval_tool_call \ No newline at end of file diff --git a/docs/reference/types/beta/threads/runs/run_step.md b/docs/reference/types/beta/threads/runs/run_step.md new file mode 100644 index 0000000000..564bf598af --- /dev/null +++ b/docs/reference/types/beta/threads/runs/run_step.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.runs.run_step \ No newline at end of file diff --git a/docs/reference/types/beta/threads/runs/step_list_params.md b/docs/reference/types/beta/threads/runs/step_list_params.md new file mode 100644 index 0000000000..3ed8f4a351 --- /dev/null +++ b/docs/reference/types/beta/threads/runs/step_list_params.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.runs.step_list_params \ No newline at end of file diff --git a/docs/reference/types/beta/threads/runs/tool_calls_step_details.md b/docs/reference/types/beta/threads/runs/tool_calls_step_details.md new file mode 100644 index 0000000000..5b13e533da --- /dev/null +++ b/docs/reference/types/beta/threads/runs/tool_calls_step_details.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.runs.tool_calls_step_details \ No newline at end of file diff --git a/docs/reference/types/beta/threads/thread_message.md b/docs/reference/types/beta/threads/thread_message.md new file mode 100644 index 0000000000..5e911c1e65 --- /dev/null +++ b/docs/reference/types/beta/threads/thread_message.md @@ -0,0 +1 @@ +::: src.openai.types.beta.threads.thread_message \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion.md b/docs/reference/types/chat/chat_completion.md new file mode 100644 index 0000000000..b33567ab35 --- /dev/null +++ b/docs/reference/types/chat/chat_completion.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion \ No newline at end of file diff --git a/docs/types/chat/chat_completion_assistant_message_param.md b/docs/reference/types/chat/chat_completion_assistant_message_param.md similarity index 96% rename from docs/types/chat/chat_completion_assistant_message_param.md rename to docs/reference/types/chat/chat_completion_assistant_message_param.md index ce064c6639..f6b0a0d545 100644 --- a/docs/types/chat/chat_completion_assistant_message_param.md +++ b/docs/reference/types/chat/chat_completion_assistant_message_param.md @@ -1 +1 @@ -::: src.openai.types.chat.chat_completion_assistant_message_param +::: src.openai.types.chat.chat_completion_assistant_message_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_chunk.md b/docs/reference/types/chat/chat_completion_chunk.md new file mode 100644 index 0000000000..033c9cfd3f --- /dev/null +++ b/docs/reference/types/chat/chat_completion_chunk.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_chunk \ No newline at end of file diff --git a/docs/types/chat/chat_completion_content_part_image_param.md b/docs/reference/types/chat/chat_completion_content_part_image_param.md similarity index 95% rename from docs/types/chat/chat_completion_content_part_image_param.md rename to docs/reference/types/chat/chat_completion_content_part_image_param.md index ee2cc7446c..24d4daba63 100644 --- a/docs/types/chat/chat_completion_content_part_image_param.md +++ b/docs/reference/types/chat/chat_completion_content_part_image_param.md @@ -1 +1 @@ -::: src.openai.types.chat.chat_completion_content_part_image_param +::: src.openai.types.chat.chat_completion_content_part_image_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_content_part_param.md b/docs/reference/types/chat/chat_completion_content_part_param.md new file mode 100644 index 0000000000..78ee22be73 --- /dev/null +++ b/docs/reference/types/chat/chat_completion_content_part_param.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_content_part_param \ No newline at end of file diff --git a/docs/types/chat/chat_completion_content_part_text_param.md b/docs/reference/types/chat/chat_completion_content_part_text_param.md similarity index 96% rename from docs/types/chat/chat_completion_content_part_text_param.md rename to docs/reference/types/chat/chat_completion_content_part_text_param.md index a9ba1e93f8..17448e203b 100644 --- a/docs/types/chat/chat_completion_content_part_text_param.md +++ b/docs/reference/types/chat/chat_completion_content_part_text_param.md @@ -1 +1 @@ -::: src.openai.types.chat.chat_completion_content_part_text_param +::: src.openai.types.chat.chat_completion_content_part_text_param \ No newline at end of file diff --git a/docs/types/chat/chat_completion_function_call_option_param.md b/docs/reference/types/chat/chat_completion_function_call_option_param.md similarity index 92% rename from docs/types/chat/chat_completion_function_call_option_param.md rename to docs/reference/types/chat/chat_completion_function_call_option_param.md index 29fee15b22..c185e3a36c 100644 --- a/docs/types/chat/chat_completion_function_call_option_param.md +++ b/docs/reference/types/chat/chat_completion_function_call_option_param.md @@ -1 +1 @@ -::: src.openai.types.chat.chat_completion_function_call_option_param +::: src.openai.types.chat.chat_completion_function_call_option_param \ No newline at end of file diff --git a/docs/types/chat/chat_completion_function_message_param.md b/docs/reference/types/chat/chat_completion_function_message_param.md similarity index 98% rename from docs/types/chat/chat_completion_function_message_param.md rename to docs/reference/types/chat/chat_completion_function_message_param.md index 25adc45a9b..6b22bbb921 100644 --- a/docs/types/chat/chat_completion_function_message_param.md +++ b/docs/reference/types/chat/chat_completion_function_message_param.md @@ -1 +1 @@ -::: src.openai.types.chat.chat_completion_function_message_param +::: src.openai.types.chat.chat_completion_function_message_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_message.md b/docs/reference/types/chat/chat_completion_message.md new file mode 100644 index 0000000000..7a0824aa34 --- /dev/null +++ b/docs/reference/types/chat/chat_completion_message.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_message \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_message_param.md b/docs/reference/types/chat/chat_completion_message_param.md new file mode 100644 index 0000000000..d20658eb95 --- /dev/null +++ b/docs/reference/types/chat/chat_completion_message_param.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_message_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_message_tool_call.md b/docs/reference/types/chat/chat_completion_message_tool_call.md new file mode 100644 index 0000000000..a7ddfec07d --- /dev/null +++ b/docs/reference/types/chat/chat_completion_message_tool_call.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_message_tool_call \ No newline at end of file diff --git a/docs/types/chat/chat_completion_message_tool_call_param.md b/docs/reference/types/chat/chat_completion_message_tool_call_param.md similarity index 96% rename from docs/types/chat/chat_completion_message_tool_call_param.md rename to docs/reference/types/chat/chat_completion_message_tool_call_param.md index e5ce3e6156..320ee22bd9 100644 --- a/docs/types/chat/chat_completion_message_tool_call_param.md +++ b/docs/reference/types/chat/chat_completion_message_tool_call_param.md @@ -1 +1 @@ -::: src.openai.types.chat.chat_completion_message_tool_call_param +::: src.openai.types.chat.chat_completion_message_tool_call_param \ No newline at end of file diff --git a/docs/types/chat/chat_completion_named_tool_choice_param.md b/docs/reference/types/chat/chat_completion_named_tool_choice_param.md similarity index 96% rename from docs/types/chat/chat_completion_named_tool_choice_param.md rename to docs/reference/types/chat/chat_completion_named_tool_choice_param.md index c8d780bc18..d8474b1e82 100644 --- a/docs/types/chat/chat_completion_named_tool_choice_param.md +++ b/docs/reference/types/chat/chat_completion_named_tool_choice_param.md @@ -1 +1 @@ -::: src.openai.types.chat.chat_completion_named_tool_choice_param +::: src.openai.types.chat.chat_completion_named_tool_choice_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_role.md b/docs/reference/types/chat/chat_completion_role.md new file mode 100644 index 0000000000..d6799ab3f7 --- /dev/null +++ b/docs/reference/types/chat/chat_completion_role.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_role \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_system_message_param.md b/docs/reference/types/chat/chat_completion_system_message_param.md new file mode 100644 index 0000000000..a9d9370015 --- /dev/null +++ b/docs/reference/types/chat/chat_completion_system_message_param.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_system_message_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_token_logprob.md b/docs/reference/types/chat/chat_completion_token_logprob.md new file mode 100644 index 0000000000..f7edf9b5c9 --- /dev/null +++ b/docs/reference/types/chat/chat_completion_token_logprob.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_token_logprob \ No newline at end of file diff --git a/docs/types/chat/chat_completion_tool_choice_option_param.md b/docs/reference/types/chat/chat_completion_tool_choice_option_param.md similarity index 95% rename from docs/types/chat/chat_completion_tool_choice_option_param.md rename to docs/reference/types/chat/chat_completion_tool_choice_option_param.md index 059d7be38a..af80f671ed 100644 --- a/docs/types/chat/chat_completion_tool_choice_option_param.md +++ b/docs/reference/types/chat/chat_completion_tool_choice_option_param.md @@ -1 +1 @@ -::: src.openai.types.chat.chat_completion_tool_choice_option_param +::: src.openai.types.chat.chat_completion_tool_choice_option_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_tool_message_param.md b/docs/reference/types/chat/chat_completion_tool_message_param.md new file mode 100644 index 0000000000..44c475a1b0 --- /dev/null +++ b/docs/reference/types/chat/chat_completion_tool_message_param.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_tool_message_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_tool_param.md b/docs/reference/types/chat/chat_completion_tool_param.md new file mode 100644 index 0000000000..eec3f17786 --- /dev/null +++ b/docs/reference/types/chat/chat_completion_tool_param.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_tool_param \ No newline at end of file diff --git a/docs/reference/types/chat/chat_completion_user_message_param.md b/docs/reference/types/chat/chat_completion_user_message_param.md new file mode 100644 index 0000000000..46da119b3e --- /dev/null +++ b/docs/reference/types/chat/chat_completion_user_message_param.md @@ -0,0 +1 @@ +::: src.openai.types.chat.chat_completion_user_message_param \ No newline at end of file diff --git a/docs/reference/types/chat/completion_create_params.md b/docs/reference/types/chat/completion_create_params.md new file mode 100644 index 0000000000..76c91cd355 --- /dev/null +++ b/docs/reference/types/chat/completion_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.chat.completion_create_params \ No newline at end of file diff --git a/docs/reference/types/chat/index.md b/docs/reference/types/chat/index.md new file mode 100644 index 0000000000..fd137aca3b --- /dev/null +++ b/docs/reference/types/chat/index.md @@ -0,0 +1 @@ +::: src.openai.types.chat \ No newline at end of file diff --git a/docs/reference/types/completion.md b/docs/reference/types/completion.md new file mode 100644 index 0000000000..30c3306085 --- /dev/null +++ b/docs/reference/types/completion.md @@ -0,0 +1 @@ +::: src.openai.types.completion \ No newline at end of file diff --git a/docs/reference/types/completion_choice.md b/docs/reference/types/completion_choice.md new file mode 100644 index 0000000000..73178a2785 --- /dev/null +++ b/docs/reference/types/completion_choice.md @@ -0,0 +1 @@ +::: src.openai.types.completion_choice \ No newline at end of file diff --git a/docs/reference/types/completion_create_params.md b/docs/reference/types/completion_create_params.md new file mode 100644 index 0000000000..66ce4750b1 --- /dev/null +++ b/docs/reference/types/completion_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.completion_create_params \ No newline at end of file diff --git a/docs/reference/types/completion_usage.md b/docs/reference/types/completion_usage.md new file mode 100644 index 0000000000..c149a33c90 --- /dev/null +++ b/docs/reference/types/completion_usage.md @@ -0,0 +1 @@ +::: src.openai.types.completion_usage \ No newline at end of file diff --git a/docs/reference/types/create_embedding_response.md b/docs/reference/types/create_embedding_response.md new file mode 100644 index 0000000000..fca5b89f4d --- /dev/null +++ b/docs/reference/types/create_embedding_response.md @@ -0,0 +1 @@ +::: src.openai.types.create_embedding_response \ No newline at end of file diff --git a/docs/reference/types/embedding.md b/docs/reference/types/embedding.md new file mode 100644 index 0000000000..aac6226984 --- /dev/null +++ b/docs/reference/types/embedding.md @@ -0,0 +1 @@ +::: src.openai.types.embedding \ No newline at end of file diff --git a/docs/reference/types/embedding_create_params.md b/docs/reference/types/embedding_create_params.md new file mode 100644 index 0000000000..f7c8ac0033 --- /dev/null +++ b/docs/reference/types/embedding_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.embedding_create_params \ No newline at end of file diff --git a/docs/reference/types/file_content.md b/docs/reference/types/file_content.md new file mode 100644 index 0000000000..bc1718717f --- /dev/null +++ b/docs/reference/types/file_content.md @@ -0,0 +1 @@ +::: src.openai.types.file_content \ No newline at end of file diff --git a/docs/reference/types/file_create_params.md b/docs/reference/types/file_create_params.md new file mode 100644 index 0000000000..27eccbb51a --- /dev/null +++ b/docs/reference/types/file_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.file_create_params \ No newline at end of file diff --git a/docs/reference/types/file_deleted.md b/docs/reference/types/file_deleted.md new file mode 100644 index 0000000000..dfc43194a4 --- /dev/null +++ b/docs/reference/types/file_deleted.md @@ -0,0 +1 @@ +::: src.openai.types.file_deleted \ No newline at end of file diff --git a/docs/reference/types/file_list_params.md b/docs/reference/types/file_list_params.md new file mode 100644 index 0000000000..0e78d03769 --- /dev/null +++ b/docs/reference/types/file_list_params.md @@ -0,0 +1 @@ +::: src.openai.types.file_list_params \ No newline at end of file diff --git a/docs/reference/types/file_object.md b/docs/reference/types/file_object.md new file mode 100644 index 0000000000..b32b031f15 --- /dev/null +++ b/docs/reference/types/file_object.md @@ -0,0 +1 @@ +::: src.openai.types.file_object \ No newline at end of file diff --git a/docs/reference/types/fine_tuning/fine_tuning_job.md b/docs/reference/types/fine_tuning/fine_tuning_job.md new file mode 100644 index 0000000000..81462821e6 --- /dev/null +++ b/docs/reference/types/fine_tuning/fine_tuning_job.md @@ -0,0 +1 @@ +::: src.openai.types.fine_tuning.fine_tuning_job \ No newline at end of file diff --git a/docs/reference/types/fine_tuning/fine_tuning_job_event.md b/docs/reference/types/fine_tuning/fine_tuning_job_event.md new file mode 100644 index 0000000000..37adc61199 --- /dev/null +++ b/docs/reference/types/fine_tuning/fine_tuning_job_event.md @@ -0,0 +1 @@ +::: src.openai.types.fine_tuning.fine_tuning_job_event \ No newline at end of file diff --git a/docs/reference/types/fine_tuning/index.md b/docs/reference/types/fine_tuning/index.md new file mode 100644 index 0000000000..a838a929fa --- /dev/null +++ b/docs/reference/types/fine_tuning/index.md @@ -0,0 +1,3 @@ +# openai.types.fine_tuning + +::: src.openai.types.fine_tuning \ No newline at end of file diff --git a/docs/reference/types/fine_tuning/job_create_params.md b/docs/reference/types/fine_tuning/job_create_params.md new file mode 100644 index 0000000000..66f76dde52 --- /dev/null +++ b/docs/reference/types/fine_tuning/job_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.fine_tuning.job_create_params \ No newline at end of file diff --git a/docs/reference/types/fine_tuning/job_list_events_params.md b/docs/reference/types/fine_tuning/job_list_events_params.md new file mode 100644 index 0000000000..55692a2af0 --- /dev/null +++ b/docs/reference/types/fine_tuning/job_list_events_params.md @@ -0,0 +1 @@ +::: src.openai.types.fine_tuning.job_list_events_params \ No newline at end of file diff --git a/docs/reference/types/fine_tuning/job_list_params.md b/docs/reference/types/fine_tuning/job_list_params.md new file mode 100644 index 0000000000..91d59b177b --- /dev/null +++ b/docs/reference/types/fine_tuning/job_list_params.md @@ -0,0 +1 @@ +::: src.openai.types.fine_tuning.job_list_params \ No newline at end of file diff --git a/docs/reference/types/image.md b/docs/reference/types/image.md new file mode 100644 index 0000000000..4bb5034e7b --- /dev/null +++ b/docs/reference/types/image.md @@ -0,0 +1 @@ +::: src.openai.types.image \ No newline at end of file diff --git a/docs/reference/types/image_create_variation_params.md b/docs/reference/types/image_create_variation_params.md new file mode 100644 index 0000000000..72c4be620e --- /dev/null +++ b/docs/reference/types/image_create_variation_params.md @@ -0,0 +1 @@ +::: src.openai.types.image_create_variation_params \ No newline at end of file diff --git a/docs/reference/types/image_edit_params.md b/docs/reference/types/image_edit_params.md new file mode 100644 index 0000000000..09150e2aea --- /dev/null +++ b/docs/reference/types/image_edit_params.md @@ -0,0 +1 @@ +::: src.openai.types.image_edit_params \ No newline at end of file diff --git a/docs/reference/types/image_generate_params.md b/docs/reference/types/image_generate_params.md new file mode 100644 index 0000000000..0f5367aa91 --- /dev/null +++ b/docs/reference/types/image_generate_params.md @@ -0,0 +1 @@ +::: src.openai.types.image_generate_params \ No newline at end of file diff --git a/docs/reference/types/images_response.md b/docs/reference/types/images_response.md new file mode 100644 index 0000000000..f2fdf37bbc --- /dev/null +++ b/docs/reference/types/images_response.md @@ -0,0 +1 @@ +::: src.openai.types.images_response \ No newline at end of file diff --git a/docs/reference/types/index.md b/docs/reference/types/index.md new file mode 100644 index 0000000000..ed9738da2d --- /dev/null +++ b/docs/reference/types/index.md @@ -0,0 +1,3 @@ +# openai.types + +::: src.openai.types \ No newline at end of file diff --git a/docs/reference/types/model.md b/docs/reference/types/model.md new file mode 100644 index 0000000000..4e94753ed5 --- /dev/null +++ b/docs/reference/types/model.md @@ -0,0 +1 @@ +::: src.openai.types.model \ No newline at end of file diff --git a/docs/reference/types/model_deleted.md b/docs/reference/types/model_deleted.md new file mode 100644 index 0000000000..36e3738cb2 --- /dev/null +++ b/docs/reference/types/model_deleted.md @@ -0,0 +1 @@ +::: src.openai.types.model_deleted \ No newline at end of file diff --git a/docs/reference/types/moderation.md b/docs/reference/types/moderation.md new file mode 100644 index 0000000000..de05bb0d1b --- /dev/null +++ b/docs/reference/types/moderation.md @@ -0,0 +1 @@ +::: src.openai.types.moderation \ No newline at end of file diff --git a/docs/reference/types/moderation_create_params.md b/docs/reference/types/moderation_create_params.md new file mode 100644 index 0000000000..f5b329dffc --- /dev/null +++ b/docs/reference/types/moderation_create_params.md @@ -0,0 +1 @@ +::: src.openai.types.moderation_create_params \ No newline at end of file diff --git a/docs/reference/types/moderation_create_response.md b/docs/reference/types/moderation_create_response.md new file mode 100644 index 0000000000..1ef4633826 --- /dev/null +++ b/docs/reference/types/moderation_create_response.md @@ -0,0 +1 @@ +::: src.openai.types.moderation_create_response \ No newline at end of file diff --git a/docs/reference/types/shared/function_definition.md b/docs/reference/types/shared/function_definition.md new file mode 100644 index 0000000000..15877dbbb8 --- /dev/null +++ b/docs/reference/types/shared/function_definition.md @@ -0,0 +1 @@ +::: src.openai.types.shared.function_definition \ No newline at end of file diff --git a/docs/reference/types/shared/function_parameters.md b/docs/reference/types/shared/function_parameters.md new file mode 100644 index 0000000000..eeacb077f4 --- /dev/null +++ b/docs/reference/types/shared/function_parameters.md @@ -0,0 +1 @@ +::: src.openai.types.shared.function_parameters \ No newline at end of file diff --git a/docs/reference/types/shared/index.md b/docs/reference/types/shared/index.md new file mode 100644 index 0000000000..d821ff5398 --- /dev/null +++ b/docs/reference/types/shared/index.md @@ -0,0 +1,3 @@ +# openai.types.shared + +::: src.openai.types.shared diff --git a/docs/reference/types/shared_params/function_definition.md b/docs/reference/types/shared_params/function_definition.md new file mode 100644 index 0000000000..95fc61e67f --- /dev/null +++ b/docs/reference/types/shared_params/function_definition.md @@ -0,0 +1 @@ +::: src.openai.types.shared_params.function_definition \ No newline at end of file diff --git a/docs/reference/types/shared_params/function_parameters.md b/docs/reference/types/shared_params/function_parameters.md new file mode 100644 index 0000000000..6f414fb4fb --- /dev/null +++ b/docs/reference/types/shared_params/function_parameters.md @@ -0,0 +1 @@ +::: src.openai.types.shared_params.function_parameters \ No newline at end of file diff --git a/docs/reference/types/shared_params/index.md b/docs/reference/types/shared_params/index.md new file mode 100644 index 0000000000..ab49f5ed07 --- /dev/null +++ b/docs/reference/types/shared_params/index.md @@ -0,0 +1,3 @@ +# openai.types.shared_params + +::: src.openai.types.shared_params \ No newline at end of file diff --git a/docs/reference/version.md b/docs/reference/version.md new file mode 100644 index 0000000000..20a49c3513 --- /dev/null +++ b/docs/reference/version.md @@ -0,0 +1 @@ +::: src.openai.version \ No newline at end of file diff --git a/docs/request-response.md b/docs/request-response.md new file mode 100644 index 0000000000..49624987ac --- /dev/null +++ b/docs/request-response.md @@ -0,0 +1,3 @@ +# Request and response types + +--8<-- "./README.md:request-response" \ No newline at end of file diff --git a/docs/resources/audio/__init__.md b/docs/resources/audio/__init__.md deleted file mode 100644 index dc237e9063..0000000000 --- a/docs/resources/audio/__init__.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.audio diff --git a/docs/resources/audio/audio.md b/docs/resources/audio/audio.md deleted file mode 100644 index 694c67ec05..0000000000 --- a/docs/resources/audio/audio.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.audio.audio diff --git a/docs/resources/audio/transcriptions.md b/docs/resources/audio/transcriptions.md deleted file mode 100644 index bfaca8011e..0000000000 --- a/docs/resources/audio/transcriptions.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.audio.transcriptions diff --git a/docs/resources/audio/translations.md b/docs/resources/audio/translations.md deleted file mode 100644 index 57de9e3b77..0000000000 --- a/docs/resources/audio/translations.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.audio.translations diff --git a/docs/resources/beta/assistants/__init__.md b/docs/resources/beta/assistants/__init__.md deleted file mode 100644 index 76c43ed0ed..0000000000 --- a/docs/resources/beta/assistants/__init__.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.assistants diff --git a/docs/resources/beta/assistants/assistants.md b/docs/resources/beta/assistants/assistants.md deleted file mode 100644 index 514279c0ec..0000000000 --- a/docs/resources/beta/assistants/assistants.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.assistants.assistants diff --git a/docs/resources/beta/assistants/files.md b/docs/resources/beta/assistants/files.md deleted file mode 100644 index 092d60b1fc..0000000000 --- a/docs/resources/beta/assistants/files.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.assistants.files diff --git a/docs/resources/beta/beta.md b/docs/resources/beta/beta.md deleted file mode 100644 index dbbe05f970..0000000000 --- a/docs/resources/beta/beta.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.beta diff --git a/docs/resources/beta/index.md b/docs/resources/beta/index.md deleted file mode 100644 index f9113dbc2f..0000000000 --- a/docs/resources/beta/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# openai.resources.beta - -::: src.openai.resources.beta diff --git a/docs/resources/beta/threads/index.md b/docs/resources/beta/threads/index.md deleted file mode 100644 index f3539842df..0000000000 --- a/docs/resources/beta/threads/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# openai.resources.beta.threads - -::: src.openai.resources.beta.threads diff --git a/docs/resources/beta/threads/messages/__init__.md b/docs/resources/beta/threads/messages/__init__.md deleted file mode 100644 index 2345668ff4..0000000000 --- a/docs/resources/beta/threads/messages/__init__.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.threads.messages diff --git a/docs/resources/beta/threads/messages/files.md b/docs/resources/beta/threads/messages/files.md deleted file mode 100644 index 49ac7a6122..0000000000 --- a/docs/resources/beta/threads/messages/files.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.threads.messages.files diff --git a/docs/resources/beta/threads/messages/messages.md b/docs/resources/beta/threads/messages/messages.md deleted file mode 100644 index b004807eed..0000000000 --- a/docs/resources/beta/threads/messages/messages.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.threads.messages.messages diff --git a/docs/resources/beta/threads/runs/__init__.md b/docs/resources/beta/threads/runs/__init__.md deleted file mode 100644 index c135529557..0000000000 --- a/docs/resources/beta/threads/runs/__init__.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.threads.runs diff --git a/docs/resources/beta/threads/runs/runs.md b/docs/resources/beta/threads/runs/runs.md deleted file mode 100644 index 0bc0dab3f3..0000000000 --- a/docs/resources/beta/threads/runs/runs.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.threads.runs.runs diff --git a/docs/resources/beta/threads/runs/steps.md b/docs/resources/beta/threads/runs/steps.md deleted file mode 100644 index 631b6da171..0000000000 --- a/docs/resources/beta/threads/runs/steps.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.threads.runs.steps diff --git a/docs/resources/beta/threads/threads.md b/docs/resources/beta/threads/threads.md deleted file mode 100644 index e9aafc24e9..0000000000 --- a/docs/resources/beta/threads/threads.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.beta.threads.threads diff --git a/docs/resources/chat/__init__.md b/docs/resources/chat/__init__.md deleted file mode 100644 index 82a19103fc..0000000000 --- a/docs/resources/chat/__init__.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.chat diff --git a/docs/resources/chat/chat.md b/docs/resources/chat/chat.md deleted file mode 100644 index 208d524ca1..0000000000 --- a/docs/resources/chat/chat.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.chat.chat diff --git a/docs/resources/chat/completions.md b/docs/resources/chat/completions.md deleted file mode 100644 index 91db1ae0a7..0000000000 --- a/docs/resources/chat/completions.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.chat.completions diff --git a/docs/resources/embeddings.md b/docs/resources/embeddings.md deleted file mode 100644 index 5b02289eb7..0000000000 --- a/docs/resources/embeddings.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.embeddings diff --git a/docs/resources/files.md b/docs/resources/files.md deleted file mode 100644 index 6999a6d0c5..0000000000 --- a/docs/resources/files.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.files diff --git a/docs/resources/fine_tuning/__init__.md b/docs/resources/fine_tuning/__init__.md deleted file mode 100644 index 3781c41dfa..0000000000 --- a/docs/resources/fine_tuning/__init__.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.fine_tuning diff --git a/docs/resources/fine_tuning/fine_tuning.md b/docs/resources/fine_tuning/fine_tuning.md deleted file mode 100644 index 95bcd86941..0000000000 --- a/docs/resources/fine_tuning/fine_tuning.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.fine_tuning.fine_tuning diff --git a/docs/resources/fine_tuning/jobs.md b/docs/resources/fine_tuning/jobs.md deleted file mode 100644 index 0de3acb8c4..0000000000 --- a/docs/resources/fine_tuning/jobs.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.fine_tuning.jobs diff --git a/docs/resources/images.md b/docs/resources/images.md deleted file mode 100644 index b39e06e69c..0000000000 --- a/docs/resources/images.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.images diff --git a/docs/resources/models.md b/docs/resources/models.md deleted file mode 100644 index c8d23d16c0..0000000000 --- a/docs/resources/models.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.models diff --git a/docs/resources/moderations.md b/docs/resources/moderations.md deleted file mode 100644 index 3b82cd5a18..0000000000 --- a/docs/resources/moderations.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.resources.moderations diff --git a/docs/types/audio/__init__.md b/docs/types/audio/__init__.md deleted file mode 100644 index 6da71321a1..0000000000 --- a/docs/types/audio/__init__.md +++ /dev/null @@ -1,8 +0,0 @@ -# openai.types.audio - -::: src.openai.types.audio -::: src.openai.types.audio.SpeechCreateParams -::: src.openai.types.audio.Transcription -::: src.openai.types.audio.TranscriptionCreateParams -::: src.openai.types.audio.Translation -::: src.openai.types.audio.TranslationCreateParams diff --git a/docs/types/audio/speech_create_params.md b/docs/types/audio/speech_create_params.md deleted file mode 100644 index 1d60e7b15c..0000000000 --- a/docs/types/audio/speech_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.audio.speech_create_params diff --git a/docs/types/audio/transcription.md b/docs/types/audio/transcription.md deleted file mode 100644 index 3a68e1cfdb..0000000000 --- a/docs/types/audio/transcription.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.audio.transcription diff --git a/docs/types/audio/transcription_create_params.md b/docs/types/audio/transcription_create_params.md deleted file mode 100644 index a8c62cd7f4..0000000000 --- a/docs/types/audio/transcription_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.audio.transcription_create_params diff --git a/docs/types/audio/translation.md b/docs/types/audio/translation.md deleted file mode 100644 index dcd0f026d4..0000000000 --- a/docs/types/audio/translation.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.audio.translation diff --git a/docs/types/audio/translation_create_params.md b/docs/types/audio/translation_create_params.md deleted file mode 100644 index e0a43090cf..0000000000 --- a/docs/types/audio/translation_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.audio.translation_create_params diff --git a/docs/types/beta/assistant.md b/docs/types/beta/assistant.md deleted file mode 100644 index bd427fbc1b..0000000000 --- a/docs/types/beta/assistant.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistant diff --git a/docs/types/beta/assistant_create_params.md b/docs/types/beta/assistant_create_params.md deleted file mode 100644 index 492b9ae329..0000000000 --- a/docs/types/beta/assistant_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistant_create_params diff --git a/docs/types/beta/assistant_deleted.md b/docs/types/beta/assistant_deleted.md deleted file mode 100644 index 56d6b98ca2..0000000000 --- a/docs/types/beta/assistant_deleted.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistant_deleted diff --git a/docs/types/beta/assistant_list_params.md b/docs/types/beta/assistant_list_params.md deleted file mode 100644 index 1569c99866..0000000000 --- a/docs/types/beta/assistant_list_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistant_list_params diff --git a/docs/types/beta/assistant_update_params.md b/docs/types/beta/assistant_update_params.md deleted file mode 100644 index 576c5c4db8..0000000000 --- a/docs/types/beta/assistant_update_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistant_update_params diff --git a/docs/types/beta/assistants/__init__.md b/docs/types/beta/assistants/__init__.md deleted file mode 100644 index 2cf0a1cd7b..0000000000 --- a/docs/types/beta/assistants/__init__.md +++ /dev/null @@ -1,7 +0,0 @@ -# openai.types.beta.assistants - -::: src.openai.types.beta.assistants -::: src.openai.types.beta.assistants.AssistantFile -::: src.openai.types.beta.assistants.FileCreateParams -::: src.openai.types.beta.assistants.FileDeleteResponse -::: src.openai.types.beta.assistants.FileListParams \ No newline at end of file diff --git a/docs/types/beta/assistants/assistant_file.md b/docs/types/beta/assistants/assistant_file.md deleted file mode 100644 index 8c3a8c15aa..0000000000 --- a/docs/types/beta/assistants/assistant_file.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistants.assistant_file diff --git a/docs/types/beta/assistants/file_create_params.md b/docs/types/beta/assistants/file_create_params.md deleted file mode 100644 index fe991f799e..0000000000 --- a/docs/types/beta/assistants/file_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistants.file_create_params diff --git a/docs/types/beta/assistants/file_delete_response.md b/docs/types/beta/assistants/file_delete_response.md deleted file mode 100644 index 48bcf278c2..0000000000 --- a/docs/types/beta/assistants/file_delete_response.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistants.file_delete_response diff --git a/docs/types/beta/assistants/file_list_params.md b/docs/types/beta/assistants/file_list_params.md deleted file mode 100644 index fc26edfacf..0000000000 --- a/docs/types/beta/assistants/file_list_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.assistants.file_list_params diff --git a/docs/types/beta/chat/__init__.md b/docs/types/beta/chat/__init__.md deleted file mode 100644 index fe7ca41ad6..0000000000 --- a/docs/types/beta/chat/__init__.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.chat diff --git a/docs/types/beta/index.md b/docs/types/beta/index.md deleted file mode 100644 index 4f13f44b21..0000000000 --- a/docs/types/beta/index.md +++ /dev/null @@ -1,12 +0,0 @@ -# openai.types.beta - -::: src.openai.types.beta.assistant_create_params -::: src.openai.types.beta.assistant_deleted -::: src.openai.types.beta.assistant_list_params -::: src.openai.types.beta.assistant_update_params -::: src.openai.types.beta.assistant -::: src.openai.types.beta.thread_create_and_run_params -::: src.openai.types.beta.thread_create_params -::: src.openai.types.beta.thread_deleted -::: src.openai.types.beta.thread_update_params -::: src.openai.types.beta.thread \ No newline at end of file diff --git a/docs/types/beta/thread.md b/docs/types/beta/thread.md deleted file mode 100644 index bbaa0a7e30..0000000000 --- a/docs/types/beta/thread.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.thread diff --git a/docs/types/beta/thread_create_and_run_params.md b/docs/types/beta/thread_create_and_run_params.md deleted file mode 100644 index 68ef3ebda7..0000000000 --- a/docs/types/beta/thread_create_and_run_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.thread_create_and_run_params diff --git a/docs/types/beta/thread_create_params.md b/docs/types/beta/thread_create_params.md deleted file mode 100644 index dd24a968b2..0000000000 --- a/docs/types/beta/thread_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.thread_create_params diff --git a/docs/types/beta/thread_deleted.md b/docs/types/beta/thread_deleted.md deleted file mode 100644 index 71ef2d76f1..0000000000 --- a/docs/types/beta/thread_deleted.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.thread_deleted diff --git a/docs/types/beta/thread_update_params.md b/docs/types/beta/thread_update_params.md deleted file mode 100644 index fe73c2c357..0000000000 --- a/docs/types/beta/thread_update_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.thread_update_params diff --git a/docs/types/beta/threads/index.md b/docs/types/beta/threads/index.md deleted file mode 100644 index c50c933d12..0000000000 --- a/docs/types/beta/threads/index.md +++ /dev/null @@ -1,14 +0,0 @@ -# openai.types.beta.threads - -::: src.openai.types.beta.threads.message_content_image_file -::: src.openai.types.beta.threads.message_content_text -::: src.openai.types.beta.threads.message_create_params -::: src.openai.types.beta.threads.message_list_params -::: src.openai.types.beta.threads.message_update_params -::: src.openai.types.beta.threads.required_action_function_tool_call -::: src.openai.types.beta.threads.run -::: src.openai.types.beta.threads.run_create_params -::: src.openai.types.beta.threads.run_list_params -::: src.openai.types.beta.threads.run_submit_tool_outputs_params -::: src.openai.types.beta.threads.run_update_params -::: src.openai.types.beta.threads.thread_message diff --git a/docs/types/beta/threads/message_content_image_file.md b/docs/types/beta/threads/message_content_image_file.md deleted file mode 100644 index 41a5cc8c03..0000000000 --- a/docs/types/beta/threads/message_content_image_file.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.message_content_image_file diff --git a/docs/types/beta/threads/message_content_text.md b/docs/types/beta/threads/message_content_text.md deleted file mode 100644 index af0d8d272d..0000000000 --- a/docs/types/beta/threads/message_content_text.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.message_content_text diff --git a/docs/types/beta/threads/message_create_params.md b/docs/types/beta/threads/message_create_params.md deleted file mode 100644 index cf02f85f3b..0000000000 --- a/docs/types/beta/threads/message_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.message_create_params diff --git a/docs/types/beta/threads/message_list_params.md b/docs/types/beta/threads/message_list_params.md deleted file mode 100644 index 15412ddd30..0000000000 --- a/docs/types/beta/threads/message_list_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.message_list_params diff --git a/docs/types/beta/threads/message_update_params.md b/docs/types/beta/threads/message_update_params.md deleted file mode 100644 index 031a0ac48e..0000000000 --- a/docs/types/beta/threads/message_update_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.message_update_params diff --git a/docs/types/beta/threads/messages/__init__.md b/docs/types/beta/threads/messages/__init__.md deleted file mode 100644 index adcc0b139c..0000000000 --- a/docs/types/beta/threads/messages/__init__.md +++ /dev/null @@ -1,2 +0,0 @@ -::: src.openai.types.beta.threads.messages.file_list_params -::: src.openai.types.beta.threads.messages.message_file diff --git a/docs/types/beta/threads/messages/file_list_params.md b/docs/types/beta/threads/messages/file_list_params.md deleted file mode 100644 index db8ae6dede..0000000000 --- a/docs/types/beta/threads/messages/file_list_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.messages.file_list_params diff --git a/docs/types/beta/threads/messages/message_file.md b/docs/types/beta/threads/messages/message_file.md deleted file mode 100644 index e1ac51ba9f..0000000000 --- a/docs/types/beta/threads/messages/message_file.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.messages.message_file diff --git a/docs/types/beta/threads/run.md b/docs/types/beta/threads/run.md deleted file mode 100644 index 96f8ae6953..0000000000 --- a/docs/types/beta/threads/run.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.run diff --git a/docs/types/beta/threads/run_create_params.md b/docs/types/beta/threads/run_create_params.md deleted file mode 100644 index b909fb03b3..0000000000 --- a/docs/types/beta/threads/run_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.run_create_params diff --git a/docs/types/beta/threads/run_list_params.md b/docs/types/beta/threads/run_list_params.md deleted file mode 100644 index 26b0341140..0000000000 --- a/docs/types/beta/threads/run_list_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.run_list_params diff --git a/docs/types/beta/threads/run_update_params.md b/docs/types/beta/threads/run_update_params.md deleted file mode 100644 index 1883a9ab5d..0000000000 --- a/docs/types/beta/threads/run_update_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.run_update_params diff --git a/docs/types/beta/threads/runs/__init__.md b/docs/types/beta/threads/runs/__init__.md deleted file mode 100644 index fc6f608b32..0000000000 --- a/docs/types/beta/threads/runs/__init__.md +++ /dev/null @@ -1,7 +0,0 @@ -::: src.openai.types.beta.threads.runs.code_tool_call -::: src.openai.types.beta.threads.runs.function_tool_call -::: src.openai.types.beta.threads.runs.message_creation_step_details -::: src.openai.types.beta.threads.runs.retrieval_tool_call -::: src.openai.types.beta.threads.runs.run_step -::: src.openai.types.beta.threads.runs.step_list_params -::: src.openai.types.beta.threads.runs.tool_calls_step_details diff --git a/docs/types/beta/threads/runs/code_tool_call.md b/docs/types/beta/threads/runs/code_tool_call.md deleted file mode 100644 index 3504ca2d55..0000000000 --- a/docs/types/beta/threads/runs/code_tool_call.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.runs.code_tool_call diff --git a/docs/types/beta/threads/runs/function_tool_call.md b/docs/types/beta/threads/runs/function_tool_call.md deleted file mode 100644 index 753f6a8c76..0000000000 --- a/docs/types/beta/threads/runs/function_tool_call.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.runs.function_tool_call diff --git a/docs/types/beta/threads/runs/retrieval_tool_call.md b/docs/types/beta/threads/runs/retrieval_tool_call.md deleted file mode 100644 index 5c731d29f3..0000000000 --- a/docs/types/beta/threads/runs/retrieval_tool_call.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.runs.retrieval_tool_call diff --git a/docs/types/beta/threads/runs/run_step.md b/docs/types/beta/threads/runs/run_step.md deleted file mode 100644 index f68722a923..0000000000 --- a/docs/types/beta/threads/runs/run_step.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.runs.run_step diff --git a/docs/types/beta/threads/runs/step_list_params.md b/docs/types/beta/threads/runs/step_list_params.md deleted file mode 100644 index 756f827028..0000000000 --- a/docs/types/beta/threads/runs/step_list_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.runs.step_list_params diff --git a/docs/types/beta/threads/runs/tool_calls_step_details.md b/docs/types/beta/threads/runs/tool_calls_step_details.md deleted file mode 100644 index d286331886..0000000000 --- a/docs/types/beta/threads/runs/tool_calls_step_details.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.runs.tool_calls_step_details diff --git a/docs/types/beta/threads/thread_message.md b/docs/types/beta/threads/thread_message.md deleted file mode 100644 index a819f95a85..0000000000 --- a/docs/types/beta/threads/thread_message.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.beta.threads.thread_message diff --git a/docs/types/chat/__init__.md b/docs/types/chat/__init__.md deleted file mode 100644 index b1e5e0239d..0000000000 --- a/docs/types/chat/__init__.md +++ /dev/null @@ -1,24 +0,0 @@ -# openai.types.chat - -::: src.openai.types.chat -::: src.openai.types.chat.ChatCompletion -::: src.openai.types.chat.ChatCompletionAssistantMessageParam -::: src.openai.types.chat.ChatCompletionChunk -::: src.openai.types.chat.ChatCompletionContentPartImageParam -::: src.openai.types.chat.ChatCompletionContentPartParam -::: src.openai.types.chat.ChatCompletionContentPartTextParam -::: src.openai.types.chat.ChatCompletionFunctionCallOptionParam -::: src.openai.types.chat.ChatCompletionFunctionMessageParam -::: src.openai.types.chat.ChatCompletionMessage -::: src.openai.types.chat.ChatCompletionMessageParam -::: src.openai.types.chat.ChatCompletionMessageToolCall -::: src.openai.types.chat.ChatCompletionMessageToolCallParam -::: src.openai.types.chat.ChatCompletionNamedToolChoiceParam -::: src.openai.types.chat.ChatCompletionRole -::: src.openai.types.chat.ChatCompletionSystemMessageParam -::: src.openai.types.chat.ChatCompletionTokenLogprob -::: src.openai.types.chat.ChatCompletionToolChoiceOptionParam -::: src.openai.types.chat.ChatCompletionToolMessageParam -::: src.openai.types.chat.ChatCompletionToolParam -::: src.openai.types.chat.ChatCompletionUserMessageParam -::: src.openai.types.chat.CompletionCreateParams \ No newline at end of file diff --git a/docs/types/chat/chat_completion.md b/docs/types/chat/chat_completion.md deleted file mode 100644 index da1424a4a7..0000000000 --- a/docs/types/chat/chat_completion.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion diff --git a/docs/types/chat/chat_completion_chunk.md b/docs/types/chat/chat_completion_chunk.md deleted file mode 100644 index c3a57a6f51..0000000000 --- a/docs/types/chat/chat_completion_chunk.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_chunk diff --git a/docs/types/chat/chat_completion_content_part_param.md b/docs/types/chat/chat_completion_content_part_param.md deleted file mode 100644 index a419d28b41..0000000000 --- a/docs/types/chat/chat_completion_content_part_param.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_content_part_param diff --git a/docs/types/chat/chat_completion_message.md b/docs/types/chat/chat_completion_message.md deleted file mode 100644 index 5b57c4c736..0000000000 --- a/docs/types/chat/chat_completion_message.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_message diff --git a/docs/types/chat/chat_completion_message_param.md b/docs/types/chat/chat_completion_message_param.md deleted file mode 100644 index e680a17bf5..0000000000 --- a/docs/types/chat/chat_completion_message_param.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_message_param diff --git a/docs/types/chat/chat_completion_message_tool_call.md b/docs/types/chat/chat_completion_message_tool_call.md deleted file mode 100644 index 44736d959c..0000000000 --- a/docs/types/chat/chat_completion_message_tool_call.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_message_tool_call diff --git a/docs/types/chat/chat_completion_role.md b/docs/types/chat/chat_completion_role.md deleted file mode 100644 index b28380e19e..0000000000 --- a/docs/types/chat/chat_completion_role.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_role diff --git a/docs/types/chat/chat_completion_system_message_param.md b/docs/types/chat/chat_completion_system_message_param.md deleted file mode 100644 index 8266d64a02..0000000000 --- a/docs/types/chat/chat_completion_system_message_param.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_system_message_param diff --git a/docs/types/chat/chat_completion_token_logprob.md b/docs/types/chat/chat_completion_token_logprob.md deleted file mode 100644 index 416ac9e898..0000000000 --- a/docs/types/chat/chat_completion_token_logprob.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_token_logprob diff --git a/docs/types/chat/chat_completion_tool_message_param.md b/docs/types/chat/chat_completion_tool_message_param.md deleted file mode 100644 index d8e51b6585..0000000000 --- a/docs/types/chat/chat_completion_tool_message_param.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_tool_message_param diff --git a/docs/types/chat/chat_completion_tool_param.md b/docs/types/chat/chat_completion_tool_param.md deleted file mode 100644 index c2bcec2b59..0000000000 --- a/docs/types/chat/chat_completion_tool_param.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_tool_param diff --git a/docs/types/chat/chat_completion_user_message_param.md b/docs/types/chat/chat_completion_user_message_param.md deleted file mode 100644 index b2648e0fb5..0000000000 --- a/docs/types/chat/chat_completion_user_message_param.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.chat_completion_user_message_param diff --git a/docs/types/chat/completion_create_params.md b/docs/types/chat/completion_create_params.md deleted file mode 100644 index c9700d59aa..0000000000 --- a/docs/types/chat/completion_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.chat.completion_create_params diff --git a/docs/types/completion.md b/docs/types/completion.md deleted file mode 100644 index 5c60c3d03e..0000000000 --- a/docs/types/completion.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.completion diff --git a/docs/types/completion_choice.md b/docs/types/completion_choice.md deleted file mode 100644 index 4f82a7bddf..0000000000 --- a/docs/types/completion_choice.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.completion_choice diff --git a/docs/types/completion_create_params.md b/docs/types/completion_create_params.md deleted file mode 100644 index 9dc0d00c5c..0000000000 --- a/docs/types/completion_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.completion_create_params diff --git a/docs/types/completion_usage.md b/docs/types/completion_usage.md deleted file mode 100644 index f37335c536..0000000000 --- a/docs/types/completion_usage.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.completion_usage diff --git a/docs/types/create_embedding_response.md b/docs/types/create_embedding_response.md deleted file mode 100644 index 45769e95a2..0000000000 --- a/docs/types/create_embedding_response.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.create_embedding_response diff --git a/docs/types/embedding.md b/docs/types/embedding.md deleted file mode 100644 index 474aeb7ed3..0000000000 --- a/docs/types/embedding.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.embedding diff --git a/docs/types/embedding_create_params.md b/docs/types/embedding_create_params.md deleted file mode 100644 index 9e210bd002..0000000000 --- a/docs/types/embedding_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.embedding_create_params diff --git a/docs/types/file_content.md b/docs/types/file_content.md deleted file mode 100644 index 8b270bfb0f..0000000000 --- a/docs/types/file_content.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.file_content diff --git a/docs/types/file_create_params.md b/docs/types/file_create_params.md deleted file mode 100644 index 40ad92c4c1..0000000000 --- a/docs/types/file_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.file_create_params diff --git a/docs/types/file_deleted.md b/docs/types/file_deleted.md deleted file mode 100644 index 9e20535189..0000000000 --- a/docs/types/file_deleted.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.file_deleted diff --git a/docs/types/file_list_params.md b/docs/types/file_list_params.md deleted file mode 100644 index c483520717..0000000000 --- a/docs/types/file_list_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.file_list_params diff --git a/docs/types/file_object.md b/docs/types/file_object.md deleted file mode 100644 index b9abcc3ee0..0000000000 --- a/docs/types/file_object.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.file_object diff --git a/docs/types/fine_tuning/__init__.md b/docs/types/fine_tuning/__init__.md deleted file mode 100644 index 7becf1c7da..0000000000 --- a/docs/types/fine_tuning/__init__.md +++ /dev/null @@ -1,7 +0,0 @@ -# openai.types.fine_tuning - -::: src.openai.types.fine_tuning.fine_tuning_job -::: src.openai.types.fine_tuning.fine_tuning_job_event -::: src.openai.types.fine_tuning.job_create_params -::: src.openai.types.fine_tuning.job_list_events_params -::: src.openai.types.fine_tuning.job_list_params \ No newline at end of file diff --git a/docs/types/fine_tuning/fine_tuning_job.md b/docs/types/fine_tuning/fine_tuning_job.md deleted file mode 100644 index d82f789824..0000000000 --- a/docs/types/fine_tuning/fine_tuning_job.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.fine_tuning.fine_tuning_job diff --git a/docs/types/fine_tuning/fine_tuning_job_event.md b/docs/types/fine_tuning/fine_tuning_job_event.md deleted file mode 100644 index d6079cda6d..0000000000 --- a/docs/types/fine_tuning/fine_tuning_job_event.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.fine_tuning.fine_tuning_job_event diff --git a/docs/types/fine_tuning/job_create_params.md b/docs/types/fine_tuning/job_create_params.md deleted file mode 100644 index b58185e58b..0000000000 --- a/docs/types/fine_tuning/job_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.fine_tuning.job_create_params diff --git a/docs/types/fine_tuning/job_list_events_params.md b/docs/types/fine_tuning/job_list_events_params.md deleted file mode 100644 index 89503419c1..0000000000 --- a/docs/types/fine_tuning/job_list_events_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.fine_tuning.job_list_events_params diff --git a/docs/types/fine_tuning/job_list_params.md b/docs/types/fine_tuning/job_list_params.md deleted file mode 100644 index 7f2595c148..0000000000 --- a/docs/types/fine_tuning/job_list_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.fine_tuning.job_list_params diff --git a/docs/types/image.md b/docs/types/image.md deleted file mode 100644 index df7bd0621c..0000000000 --- a/docs/types/image.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.image diff --git a/docs/types/image_create_variation_params.md b/docs/types/image_create_variation_params.md deleted file mode 100644 index 3fc74be3ca..0000000000 --- a/docs/types/image_create_variation_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.image_create_variation_params diff --git a/docs/types/image_edit_params.md b/docs/types/image_edit_params.md deleted file mode 100644 index dd5b5ecd09..0000000000 --- a/docs/types/image_edit_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.image_edit_params diff --git a/docs/types/image_generate_params.md b/docs/types/image_generate_params.md deleted file mode 100644 index 3476a497ae..0000000000 --- a/docs/types/image_generate_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.image_generate_params diff --git a/docs/types/images_response.md b/docs/types/images_response.md deleted file mode 100644 index ccb0c46125..0000000000 --- a/docs/types/images_response.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.images_response diff --git a/docs/types/index.md b/docs/types/index.md deleted file mode 100644 index a1ffe287a9..0000000000 --- a/docs/types/index.md +++ /dev/null @@ -1,45 +0,0 @@ -# openai.types - -::: src.openai.types.completion -::: src.openai.types.completion_choice -::: src.openai.types.completion_choice.CompletionChoice -::: src.openai.types.completion_create_params -::: src.openai.types.completion_create_params.CompletionCreateParams -::: src.openai.types.completion_usage -::: src.openai.types.completion_usage.CompletionUsage -::: src.openai.types.completion.Completion -::: src.openai.types.create_embedding_response -::: src.openai.types.create_embedding_response.CreateEmbeddingResponse -::: src.openai.types.embedding -::: src.openai.types.embedding_create_params -::: src.openai.types.embedding_create_params.EmbeddingCreateParams -::: src.openai.types.embedding.Embedding -::: src.openai.types.file_content -::: src.openai.types.file_content.FileContent -::: src.openai.types.file_create_params -::: src.openai.types.file_create_params.FileCreateParams -::: src.openai.types.file_deleted -::: src.openai.types.file_deleted.FileDeleted -::: src.openai.types.file_list_params -::: src.openai.types.file_list_params.FileListParams -::: src.openai.types.file_object -::: src.openai.types.file_object.FileObject -::: src.openai.types.image -::: src.openai.types.image_create_variation_params -::: src.openai.types.image_create_variation_params.ImageCreateVariationParams -::: src.openai.types.image_edit_params -::: src.openai.types.image_edit_params.ImageEditParams -::: src.openai.types.image_generate_params -::: src.openai.types.image_generate_params.ImageGenerateParams -::: src.openai.types.image.Image -::: src.openai.types.images_response -::: src.openai.types.images_response.ImagesResponse -::: src.openai.types.model -::: src.openai.types.model_deleted -::: src.openai.types.model_deleted.ModelDeleted -::: src.openai.types.model.Model -::: src.openai.types.moderation -::: src.openai.types.moderation_create_params -::: src.openai.types.moderation_create_params.ModerationCreateParams -::: src.openai.types.moderation_create_response -::: src.openai.types.moderation_create_response.ModerationCreateResponse \ No newline at end of file diff --git a/docs/types/model.md b/docs/types/model.md deleted file mode 100644 index 89103eaa01..0000000000 --- a/docs/types/model.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.model diff --git a/docs/types/model_deleted.md b/docs/types/model_deleted.md deleted file mode 100644 index 29e90579c4..0000000000 --- a/docs/types/model_deleted.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.model_deleted diff --git a/docs/types/moderation.md b/docs/types/moderation.md deleted file mode 100644 index 655260d1ac..0000000000 --- a/docs/types/moderation.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.moderation diff --git a/docs/types/moderation_create_params.md b/docs/types/moderation_create_params.md deleted file mode 100644 index c49d20a883..0000000000 --- a/docs/types/moderation_create_params.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.moderation_create_params diff --git a/docs/types/moderation_create_response.md b/docs/types/moderation_create_response.md deleted file mode 100644 index 4f0c1408d2..0000000000 --- a/docs/types/moderation_create_response.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.moderation_create_response diff --git a/docs/types/shared/__init__.md b/docs/types/shared/__init__.md deleted file mode 100644 index 4c8371d211..0000000000 --- a/docs/types/shared/__init__.md +++ /dev/null @@ -1,6 +0,0 @@ -# openai.types.shared - -::: src.openai.types.shared.function_definition -::: src.openai.types.shared.function_parameters -::: src.openai.types.shared.FunctionDefinition -::: src.openai.types.shared.FunctionParameters diff --git a/docs/types/shared/function_definition.md b/docs/types/shared/function_definition.md deleted file mode 100644 index 416dcf495a..0000000000 --- a/docs/types/shared/function_definition.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.shared.function_definition diff --git a/docs/types/shared/function_parameters.md b/docs/types/shared/function_parameters.md deleted file mode 100644 index 92304a29f5..0000000000 --- a/docs/types/shared/function_parameters.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.shared.function_parameters diff --git a/docs/types/shared_params/__init__.md b/docs/types/shared_params/__init__.md deleted file mode 100644 index 98fd91340b..0000000000 --- a/docs/types/shared_params/__init__.md +++ /dev/null @@ -1,4 +0,0 @@ -# openai.types.shared_params - -::: src.openai.types.shared_params.function_definition -::: src.openai.types.shared_params.function_parameters \ No newline at end of file diff --git a/docs/types/shared_params/function_definition.md b/docs/types/shared_params/function_definition.md deleted file mode 100644 index fd8c157949..0000000000 --- a/docs/types/shared_params/function_definition.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.shared_params.function_definition diff --git a/docs/types/shared_params/function_parameters.md b/docs/types/shared_params/function_parameters.md deleted file mode 100644 index 5a7620fe10..0000000000 --- a/docs/types/shared_params/function_parameters.md +++ /dev/null @@ -1 +0,0 @@ -::: src.openai.types.shared_params.function_parameters diff --git a/docs/version.md b/docs/version.md deleted file mode 100644 index 866ae1a54c..0000000000 --- a/docs/version.md +++ /dev/null @@ -1,3 +0,0 @@ -# openai.version - -::: src.openai.version diff --git a/mkdocs-requirements.txt b/mkdocs-requirements.txt index a1e1c7e0a9..269c93ba51 100644 --- a/mkdocs-requirements.txt +++ b/mkdocs-requirements.txt @@ -14,10 +14,12 @@ MarkupSafe==2.1.5 mergedeep==1.3.4 mkdocs==1.5.3 mkdocs-autorefs==0.5.0 +mkdocs-gen-files==0.5.0 +mkdocs-literate-nav==0.6.1 mkdocs-material==9.5.8 mkdocs-material-extensions==1.3.1 mkdocstrings==0.24.0 -mkdocstrings-python==1.8.0 +mkdocstrings-python @ git+ssh://git@github.com/pawamoy-insiders/mkdocstrings-python.git@157224dddefd2f2b979f9e92f0506e44c1548f64 mypy-extensions==1.0.0 packaging==23.2 paginate==0.5.6 diff --git a/mkdocs.yml b/mkdocs.yml index abbf785437..358cdac97b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -57,6 +57,7 @@ markdown_extensions: - admonition - attr_list - md_in_html + - pymdownx.details - pymdownx.emoji: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:material.extensions.emoji.to_svg @@ -70,6 +71,11 @@ markdown_extensions: plugins: - search + # - gen-files: + # scripts: + # - scripts/gen_ref_nav.py # Can't run automatically because the src/openai/lib/azure.py busts the build + - literate-nav: + nav_file: SUMMARY.md - mkdocstrings: handlers: python: @@ -82,7 +88,8 @@ plugins: options: docstring_options: ignore_init_summary: true - docstring_section_style: spacy + summary: true + docstring_section_style: table docstring_style: google extensions: - griffe_inherited_docstrings @@ -94,7 +101,7 @@ plugins: show_bases: true show_if_no_docstring: true show_root_full_path: false - show_root_heading: true + show_root_heading: false show_signature_annotations: true show_source: false show_symbol_type_heading: true @@ -109,36 +116,15 @@ extra: link: https://github.com/mmacy nav: - - index.md - - get_started.md - - API reference: - - openai.md - - pagination.md - - version.md - - openai.resources: - - resources/index.md - - openai.resources.audio: resources/audio/__init__.md - - openai.resources.beta: - - resources/beta/index.md - - openai.resources.beta.assistants: resources/beta/assistants/__init__.md - - openai.resources.beta.threads: - - resources/beta/threads/index.md - - openai.resources.beta.threads.messages: resources/beta/threads/messages/__init__.md - - openai.resources.beta.threads.runs: resources/beta/threads/runs/__init__.md - - openai.resources.chat: resources/chat/__init__.md - - openai.resources.fine_tuning: resources/fine_tuning/__init__.md - - openai.types: - - types/index.md # was __init__.md - - openai.types.audio: types/audio/__init__.md - - openai.types.beta: - - types/beta/index.md - - openai.types.beta.assistants: types/beta/assistants/__init__.md - - openai.types.beta.chat: types/beta/chat/__init__.md - - openai.types.beta.threads: - - types/beta/threads/index.md - - openai.types.beta.threads.messages: types/beta/threads/messages/__init__.md - - openai.types.beta.threads.runs: types/beta/threads/runs/__init__.md - - openai.types.chat: types/chat/__init__.md - - openai.types.fine_tuning: types/fine_tuning/__init__.md - - openai.types.shared: types/shared/__init__.md - - openai.types.shared_params: types/shared_params/__init__.md + - Welcome: + - index.md + - Get started: get_started.md + - API reference: reference/index.md + - Get started: + - get_started.md + - connect.md + - request-response.md + - error-handling.md + - debugging.md + - advanced.md + - API reference: reference/ diff --git a/scripts/gen_ref_nav.py b/scripts/gen_ref_nav.py index 9c041ede7d..51a7d20429 100644 --- a/scripts/gen_ref_nav.py +++ b/scripts/gen_ref_nav.py @@ -4,14 +4,13 @@ import mkdocs_gen_files -nav = mkdocs_gen_files.Nav() -mod_symbol = '' +nav = mkdocs_gen_files.nav.Nav() src = Path(__file__).parent.parent / "src" for path in sorted(src.rglob("*.py")): module_path = path.relative_to(src).with_suffix("") - doc_path = path.relative_to(src / "mkdocstrings").with_suffix(".md") + doc_path = path.relative_to(src / "openai").with_suffix(".md") full_doc_path = Path("reference", doc_path) parts = tuple(module_path.parts) @@ -23,12 +22,15 @@ elif parts[-1].startswith("_"): continue - nav_parts = [f"{mod_symbol} {part}" for part in parts] + nav_parts = [part for part in parts] nav[tuple(nav_parts)] = doc_path.as_posix() with mkdocs_gen_files.open(full_doc_path, "w") as fd: ident = ".".join(parts) - fd.write(f"::: {ident}") + if "openai.lib.azure" not in ident: + fd.write(f"::: src.{ident}") + else: + fd.write(f"") # azure.py busts the doc build mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path) diff --git a/src/openai/lib/azure.py.BUSTED b/src/openai/lib/azure.py.BUSTED new file mode 100644 index 0000000000..2c8b4dcd88 --- /dev/null +++ b/src/openai/lib/azure.py.BUSTED @@ -0,0 +1,529 @@ +from __future__ import annotations + +import os +import inspect +from typing import Any, Union, Mapping, TypeVar, Callable, Awaitable, overload +from typing_extensions import Self, override + +import httpx + +from .._types import NOT_GIVEN, Omit, Timeout, NotGiven +from .._utils import is_given, is_mapping +from .._client import OpenAI, AsyncOpenAI +from .._models import FinalRequestOptions +from .._streaming import Stream, AsyncStream +from .._exceptions import OpenAIError +from .._base_client import DEFAULT_MAX_RETRIES, BaseClient + +_deployments_endpoints = set( + [ + "/completions", + "/chat/completions", + "/embeddings", + "/audio/transcriptions", + "/audio/translations", + "/audio/speech", + "/images/generations", + ] +) + + +AzureADTokenProvider = Callable[[], str] +AsyncAzureADTokenProvider = Callable[[], "str | Awaitable[str]"] +_HttpxClientT = TypeVar("_HttpxClientT", bound=Union[httpx.Client, httpx.AsyncClient]) +_DefaultStreamT = TypeVar("_DefaultStreamT", bound=Union[Stream[Any], AsyncStream[Any]]) + + +# we need to use a sentinel API key value for Azure AD +# as we don't want to make the `api_key` in the main client Optional +# and Azure AD tokens may be retrieved on a per-request basis +API_KEY_SENTINEL = "".join(["<", "missing API key", ">"]) + + +class MutuallyExclusiveAuthError(OpenAIError): + def __init__(self) -> None: + super().__init__( + "The `api_key`, `azure_ad_token` and `azure_ad_token_provider` arguments are mutually exclusive; Only one can be passed at a time" + ) + + +class BaseAzureClient(BaseClient[_HttpxClientT, _DefaultStreamT]): + @override + def _build_request( + self, + options: FinalRequestOptions, + ) -> httpx.Request: + if options.url in _deployments_endpoints and is_mapping(options.json_data): + model = options.json_data.get("model") + if model is not None and not "/deployments" in str(self.base_url): + options.url = f"/deployments/{model}{options.url}" + + return super()._build_request(options) + + +class AzureOpenAI(BaseAzureClient[httpx.Client, Stream[Any]], OpenAI): + @overload + def __init__( + self, + *, + azure_endpoint: str, + azure_deployment: str | None = None, + api_version: str | None = None, + api_key: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AzureADTokenProvider | None = None, + organization: str | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + http_client: httpx.Client | None = None, + _strict_response_validation: bool = False, + ) -> None: + ... + + @overload + def __init__( + self, + *, + azure_deployment: str | None = None, + api_version: str | None = None, + api_key: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AzureADTokenProvider | None = None, + organization: str | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + http_client: httpx.Client | None = None, + _strict_response_validation: bool = False, + ) -> None: + ... + + @overload + def __init__( + self, + *, + base_url: str, + api_version: str | None = None, + api_key: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AzureADTokenProvider | None = None, + organization: str | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + http_client: httpx.Client | None = None, + _strict_response_validation: bool = False, + ) -> None: + ... + + def __init__( + self, + *, + api_version: str | None = None, + azure_endpoint: str | None = None, + azure_deployment: str | None = None, + api_key: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AzureADTokenProvider | None = None, + organization: str | None = None, + base_url: str | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + http_client: httpx.Client | None = None, + _strict_response_validation: bool = False, + ) -> None: + """Construct a new synchronous azure openai client instance. + + This automatically infers the following arguments from their corresponding environment variables if they are not provided: + - `api_key` from `AZURE_OPENAI_API_KEY` + - `organization` from `OPENAI_ORG_ID` + - `azure_ad_token` from `AZURE_OPENAI_AD_TOKEN` + - `api_version` from `OPENAI_API_VERSION` + - `azure_endpoint` from `AZURE_OPENAI_ENDPOINT` + + Args: + azure_endpoint: Your Azure endpoint, including the resource, e.g. `https://example-resource.azure.openai.com/` + + azure_ad_token: Your Azure Active Directory token, https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id + + azure_ad_token_provider: A function that returns an Azure Active Directory token, will be invoked on every request. + + azure_deployment: A model deployment, if given sets the base client URL to include `/deployments/{azure_deployment}`. + Note: this means you won't be able to use non-deployment endpoints. + """ + if api_key is None: + api_key = os.environ.get("AZURE_OPENAI_API_KEY") + + if azure_ad_token is None: + azure_ad_token = os.environ.get("AZURE_OPENAI_AD_TOKEN") + + if api_key is None and azure_ad_token is None and azure_ad_token_provider is None: + raise OpenAIError( + "Missing credentials. Please pass one of `api_key`, `azure_ad_token`, `azure_ad_token_provider`, or the `AZURE_OPENAI_API_KEY` or `AZURE_OPENAI_AD_TOKEN` environment variables." + ) + + if api_version is None: + api_version = os.environ.get("OPENAI_API_VERSION") + + if api_version is None: + raise ValueError( + "Must provide either the `api_version` argument or the `OPENAI_API_VERSION` environment variable" + ) + + if default_query is None: + default_query = {"api-version": api_version} + else: + default_query = {**default_query, "api-version": api_version} + + if base_url is None: + if azure_endpoint is None: + azure_endpoint = os.environ.get("AZURE_OPENAI_ENDPOINT") + + if azure_endpoint is None: + raise ValueError( + "Must provide one of the `base_url` or `azure_endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable" + ) + + if azure_deployment is not None: + base_url = f"{azure_endpoint}/openai/deployments/{azure_deployment}" + else: + base_url = f"{azure_endpoint}/openai" + else: + if azure_endpoint is not None: + raise ValueError("base_url and azure_endpoint are mutually exclusive") + + if api_key is None: + # define a sentinel value to avoid any typing issues + api_key = API_KEY_SENTINEL + + super().__init__( + api_key=api_key, + organization=organization, + base_url=base_url, + timeout=timeout, + max_retries=max_retries, + default_headers=default_headers, + default_query=default_query, + http_client=http_client, + _strict_response_validation=_strict_response_validation, + ) + self._api_version = api_version + self._azure_ad_token = azure_ad_token + self._azure_ad_token_provider = azure_ad_token_provider + + @override + def copy( + self, + *, + api_key: str | None = None, + organization: str | None = None, + api_version: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AzureADTokenProvider | None = None, + base_url: str | httpx.URL | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + http_client: httpx.Client | None = None, + max_retries: int | NotGiven = NOT_GIVEN, + default_headers: Mapping[str, str] | None = None, + set_default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + set_default_query: Mapping[str, object] | None = None, + _extra_kwargs: Mapping[str, Any] = {}, + ) -> Self: + """ + Create a new client instance re-using the same options given to the current client with optional overriding. + """ + return super().copy( + api_key=api_key, + organization=organization, + base_url=base_url, + timeout=timeout, + http_client=http_client, + max_retries=max_retries, + default_headers=default_headers, + set_default_headers=set_default_headers, + default_query=default_query, + set_default_query=set_default_query, + _extra_kwargs={ + "api_version": api_version or self._api_version, + "azure_ad_token": azure_ad_token or self._azure_ad_token, + "azure_ad_token_provider": azure_ad_token_provider or self._azure_ad_token_provider, + **_extra_kwargs, + }, + ) + + with_options = copy + + def _get_azure_ad_token(self) -> str | None: + if self._azure_ad_token is not None: + return self._azure_ad_token + + provider = self._azure_ad_token_provider + if provider is not None: + token = provider() + if not token or not isinstance(token, str): # pyright: ignore[reportUnnecessaryIsInstance] + raise ValueError( + f"Expected `azure_ad_token_provider` argument to return a string but it returned {token}", + ) + return token + + return None + + @override + def _prepare_options(self, options: FinalRequestOptions) -> None: + headers: dict[str, str | Omit] = {**options.headers} if is_given(options.headers) else {} + options.headers = headers + + azure_ad_token = self._get_azure_ad_token() + if azure_ad_token is not None: + if headers.get("Authorization") is None: + headers["Authorization"] = f"Bearer {azure_ad_token}" + elif self.api_key is not API_KEY_SENTINEL: + if headers.get("api-key") is None: + headers["api-key"] = self.api_key + else: + # should never be hit + raise ValueError("Unable to handle auth") + + return super()._prepare_options(options) + + +class AsyncAzureOpenAI(BaseAzureClient[httpx.AsyncClient, AsyncStream[Any]], AsyncOpenAI): + @overload + def __init__( + self, + *, + azure_endpoint: str, + azure_deployment: str | None = None, + api_version: str | None = None, + api_key: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AsyncAzureADTokenProvider | None = None, + organization: str | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + http_client: httpx.AsyncClient | None = None, + _strict_response_validation: bool = False, + ) -> None: + ... + + @overload + def __init__( + self, + *, + azure_deployment: str | None = None, + api_version: str | None = None, + api_key: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AsyncAzureADTokenProvider | None = None, + organization: str | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + http_client: httpx.AsyncClient | None = None, + _strict_response_validation: bool = False, + ) -> None: + ... + + @overload + def __init__( + self, + *, + base_url: str, + api_version: str | None = None, + api_key: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AsyncAzureADTokenProvider | None = None, + organization: str | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + http_client: httpx.AsyncClient | None = None, + _strict_response_validation: bool = False, + ) -> None: + ... + + def __init__( + self, + *, + azure_endpoint: str | None = None, + azure_deployment: str | None = None, + api_version: str | None = None, + api_key: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AsyncAzureADTokenProvider | None = None, + organization: str | None = None, + base_url: str | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + http_client: httpx.AsyncClient | None = None, + _strict_response_validation: bool = False, + ) -> None: + """Construct a new asynchronous azure openai client instance. + + This automatically infers the following arguments from their corresponding environment variables if they are not provided: + - `api_key` from `AZURE_OPENAI_API_KEY` + - `organization` from `OPENAI_ORG_ID` + - `azure_ad_token` from `AZURE_OPENAI_AD_TOKEN` + - `api_version` from `OPENAI_API_VERSION` + - `azure_endpoint` from `AZURE_OPENAI_ENDPOINT` + + Args: + azure_endpoint: Your Azure endpoint, including the resource, e.g. `https://example-resource.azure.openai.com/` + + azure_ad_token: Your Azure Active Directory token, https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id + + azure_ad_token_provider: A function that returns an Azure Active Directory token, will be invoked on every request. + + azure_deployment: A model deployment, if given sets the base client URL to include `/deployments/{azure_deployment}`. + Note: this means you won't be able to use non-deployment endpoints. + """ + if api_key is None: + api_key = os.environ.get("AZURE_OPENAI_API_KEY") + + if azure_ad_token is None: + azure_ad_token = os.environ.get("AZURE_OPENAI_AD_TOKEN") + + if api_key is None and azure_ad_token is None and azure_ad_token_provider is None: + raise OpenAIError( + "Missing credentials. Please pass one of `api_key`, `azure_ad_token`, `azure_ad_token_provider`, or the `AZURE_OPENAI_API_KEY` or `AZURE_OPENAI_AD_TOKEN` environment variables." + ) + + if api_version is None: + api_version = os.environ.get("OPENAI_API_VERSION") + + if api_version is None: + raise ValueError( + "Must provide either the `api_version` argument or the `OPENAI_API_VERSION` environment variable" + ) + + if default_query is None: + default_query = {"api-version": api_version} + else: + default_query = {**default_query, "api-version": api_version} + + if base_url is None: + if azure_endpoint is None: + azure_endpoint = os.environ.get("AZURE_OPENAI_ENDPOINT") + + if azure_endpoint is None: + raise ValueError( + "Must provide one of the `base_url` or `azure_endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable" + ) + + if azure_deployment is not None: + base_url = f"{azure_endpoint}/openai/deployments/{azure_deployment}" + else: + base_url = f"{azure_endpoint}/openai" + else: + if azure_endpoint is not None: + raise ValueError("base_url and azure_endpoint are mutually exclusive") + + if api_key is None: + # define a sentinel value to avoid any typing issues + api_key = API_KEY_SENTINEL + + super().__init__( + api_key=api_key, + organization=organization, + base_url=base_url, + timeout=timeout, + max_retries=max_retries, + default_headers=default_headers, + default_query=default_query, + http_client=http_client, + _strict_response_validation=_strict_response_validation, + ) + self._api_version = api_version + self._azure_ad_token = azure_ad_token + self._azure_ad_token_provider = azure_ad_token_provider + + @override + def copy( + self, + *, + api_key: str | None = None, + organization: str | None = None, + api_version: str | None = None, + azure_ad_token: str | None = None, + azure_ad_token_provider: AsyncAzureADTokenProvider | None = None, + base_url: str | httpx.URL | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + http_client: httpx.AsyncClient | None = None, + max_retries: int | NotGiven = NOT_GIVEN, + default_headers: Mapping[str, str] | None = None, + set_default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + set_default_query: Mapping[str, object] | None = None, + _extra_kwargs: Mapping[str, Any] = {}, + ) -> Self: + """ + Create a new client instance re-using the same options given to the current client with optional overriding. + """ + return super().copy( + api_key=api_key, + organization=organization, + base_url=base_url, + timeout=timeout, + http_client=http_client, + max_retries=max_retries, + default_headers=default_headers, + set_default_headers=set_default_headers, + default_query=default_query, + set_default_query=set_default_query, + _extra_kwargs={ + "api_version": api_version or self._api_version, + "azure_ad_token": azure_ad_token or self._azure_ad_token, + "azure_ad_token_provider": azure_ad_token_provider or self._azure_ad_token_provider, + **_extra_kwargs, + }, + ) + + with_options = copy + + async def _get_azure_ad_token(self) -> str | None: + if self._azure_ad_token is not None: + return self._azure_ad_token + + provider = self._azure_ad_token_provider + if provider is not None: + token = provider() + if inspect.isawaitable(token): + token = await token + if not token or not isinstance(token, str): + raise ValueError( + f"Expected `azure_ad_token_provider` argument to return a string but it returned {token}", + ) + return token + + return None + + @override + async def _prepare_options(self, options: FinalRequestOptions) -> None: + headers: dict[str, str | Omit] = {**options.headers} if is_given(options.headers) else {} + options.headers = headers + + azure_ad_token = await self._get_azure_ad_token() + if azure_ad_token is not None: + if headers.get("Authorization") is None: + headers["Authorization"] = f"Bearer {azure_ad_token}" + elif self.api_key is not API_KEY_SENTINEL: + if headers.get("api-key") is None: + headers["api-key"] = self.api_key + else: + # should never be hit + raise ValueError("Unable to handle auth") + + return await super()._prepare_options(options) diff --git a/src/openai/resources/chat/completions.py b/src/openai/resources/chat/completions.py index 0011d75e6e..88834839a5 100644 --- a/src/openai/resources/chat/completions.py +++ b/src/openai/resources/chat/completions.py @@ -660,6 +660,142 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ChatCompletion | Stream[ChatCompletionChunk]: + """ + Creates a model response for the given chat conversation. + + Args: + messages: A list of messages comprising the conversation so far. + [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models). + + model: ID of the model to use. See the + [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) + table for details on which models work with the Chat API. + + frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their + existing frequency in the text so far, decreasing the model's likelihood to + repeat the same line verbatim. + + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details) + + function_call: Deprecated in favor of `tool_choice`. + + Controls which (if any) function is called by the model. `none` means the model + will not call a function and instead generates a message. `auto` means the model + can pick between generating a message or calling a function. Specifying a + particular function via `{"name": "my_function"}` forces the model to call that + function. + + `none` is the default when no functions are present. `auto` is the default if + functions are present. + + functions: Deprecated in favor of `tools`. + + A list of functions the model may generate JSON inputs for. + + logit_bias: Modify the likelihood of specified tokens appearing in the completion. + + Accepts a JSON object that maps tokens (specified by their token ID in the + tokenizer) to an associated bias value from -100 to 100. Mathematically, the + bias is added to the logits generated by the model prior to sampling. The exact + effect will vary per model, but values between -1 and 1 should decrease or + increase likelihood of selection; values like -100 or 100 should result in a ban + or exclusive selection of the relevant token. + + logprobs: Whether to return log probabilities of the output tokens or not. If true, + returns the log probabilities of each output token returned in the `content` of + `message`. This option is currently not available on the `gpt-4-vision-preview` + model. + + max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the chat + completion. + + The total length of input tokens and generated tokens is limited by the model's + context length. + [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) + for counting tokens. + + n: How many chat completion choices to generate for each input message. Note that + you will be charged based on the number of generated tokens across all of the + choices. Keep `n` as `1` to minimize costs. + + presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on + whether they appear in the text so far, increasing the model's likelihood to + talk about new topics. + + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details) + + response_format: An object specifying the format that the model must output. Compatible with + [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and + all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + + seed: This feature is in Beta. If specified, our system will make a best effort to + sample deterministically, such that repeated requests with the same `seed` and + parameters should return the same result. Determinism is not guaranteed, and you + should refer to the `system_fingerprint` response parameter to monitor changes + in the backend. + + stop: Up to 4 sequences where the API will stop generating further tokens. + + stream: If set, partial message deltas will be sent, like in ChatGPT. Tokens will be + sent as data-only + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` + message. + [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. + + We generally recommend altering this or `top_p` but not both. + + tool_choice: Controls which (if any) function is called by the model. `none` means the model + will not call a function and instead generates a message. `auto` means the model + can pick between generating a message or calling a function. Specifying a + particular function via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that function. + + `none` is the default when no functions are present. `auto` is the default if + functions are present. + + tools: A list of tools the model may call. Currently, only functions are supported as a + tool. Use this to provide a list of functions the model may generate JSON inputs + for. + + top_logprobs: An integer between 0 and 5 specifying the number of most likely tokens to return + at each token position, each with an associated log probability. `logprobs` must + be set to `true` if this parameter is used. + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help OpenAI to monitor + and detect abuse. + [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return self._post( "/chat/completions", body=maybe_transform( @@ -1327,6 +1463,142 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ChatCompletion | AsyncStream[ChatCompletionChunk]: + """ + Creates a model response for the given chat conversation. + + Args: + messages: A list of messages comprising the conversation so far. + [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models). + + model: ID of the model to use. See the + [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) + table for details on which models work with the Chat API. + + frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their + existing frequency in the text so far, decreasing the model's likelihood to + repeat the same line verbatim. + + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details) + + function_call: Deprecated in favor of `tool_choice`. + + Controls which (if any) function is called by the model. `none` means the model + will not call a function and instead generates a message. `auto` means the model + can pick between generating a message or calling a function. Specifying a + particular function via `{"name": "my_function"}` forces the model to call that + function. + + `none` is the default when no functions are present. `auto` is the default if + functions are present. + + functions: Deprecated in favor of `tools`. + + A list of functions the model may generate JSON inputs for. + + logit_bias: Modify the likelihood of specified tokens appearing in the completion. + + Accepts a JSON object that maps tokens (specified by their token ID in the + tokenizer) to an associated bias value from -100 to 100. Mathematically, the + bias is added to the logits generated by the model prior to sampling. The exact + effect will vary per model, but values between -1 and 1 should decrease or + increase likelihood of selection; values like -100 or 100 should result in a ban + or exclusive selection of the relevant token. + + logprobs: Whether to return log probabilities of the output tokens or not. If true, + returns the log probabilities of each output token returned in the `content` of + `message`. This option is currently not available on the `gpt-4-vision-preview` + model. + + max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the chat + completion. + + The total length of input tokens and generated tokens is limited by the model's + context length. + [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) + for counting tokens. + + n: How many chat completion choices to generate for each input message. Note that + you will be charged based on the number of generated tokens across all of the + choices. Keep `n` as `1` to minimize costs. + + presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on + whether they appear in the text so far, increasing the model's likelihood to + talk about new topics. + + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details) + + response_format: An object specifying the format that the model must output. Compatible with + [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and + all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + + seed: This feature is in Beta. If specified, our system will make a best effort to + sample deterministically, such that repeated requests with the same `seed` and + parameters should return the same result. Determinism is not guaranteed, and you + should refer to the `system_fingerprint` response parameter to monitor changes + in the backend. + + stop: Up to 4 sequences where the API will stop generating further tokens. + + stream: If set, partial message deltas will be sent, like in ChatGPT. Tokens will be + sent as data-only + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` + message. + [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. + + We generally recommend altering this or `top_p` but not both. + + tool_choice: Controls which (if any) function is called by the model. `none` means the model + will not call a function and instead generates a message. `auto` means the model + can pick between generating a message or calling a function. Specifying a + particular function via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that function. + + `none` is the default when no functions are present. `auto` is the default if + functions are present. + + tools: A list of tools the model may call. Currently, only functions are supported as a + tool. Use this to provide a list of functions the model may generate JSON inputs + for. + + top_logprobs: An integer between 0 and 5 specifying the number of most likely tokens to return + at each token position, each with an associated log probability. `logprobs` must + be set to `true` if this parameter is used. + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help OpenAI to monitor + and detect abuse. + [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return await self._post( "/chat/completions", body=maybe_transform( diff --git a/src/openai/resources/completions.py b/src/openai/resources/completions.py index af2d6e2e51..f3d1375d6e 100644 --- a/src/openai/resources/completions.py +++ b/src/openai/resources/completions.py @@ -503,6 +503,124 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Completion | Stream[Completion]: + """ + Creates a completion for the provided prompt and parameters. + + Args: + model: ID of the model to use. You can use the + [List models](https://platform.openai.com/docs/api-reference/models/list) API to + see all of your available models, or see our + [Model overview](https://platform.openai.com/docs/models/overview) for + descriptions of them. + + prompt: The prompt(s) to generate completions for, encoded as a string, array of + strings, array of tokens, or array of token arrays. + + Note that <|endoftext|> is the document separator that the model sees during + training, so if a prompt is not specified the model will generate as if from the + beginning of a new document. + + best_of: Generates `best_of` completions server-side and returns the "best" (the one with + the highest log probability per token). Results cannot be streamed. + + When used with `n`, `best_of` controls the number of candidate completions and + `n` specifies how many to return – `best_of` must be greater than `n`. + + **Note:** Because this parameter generates many completions, it can quickly + consume your token quota. Use carefully and ensure that you have reasonable + settings for `max_tokens` and `stop`. + + echo: Echo back the prompt in addition to the completion + + frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their + existing frequency in the text so far, decreasing the model's likelihood to + repeat the same line verbatim. + + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details) + + logit_bias: Modify the likelihood of specified tokens appearing in the completion. + + Accepts a JSON object that maps tokens (specified by their token ID in the GPT + tokenizer) to an associated bias value from -100 to 100. You can use this + [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. + Mathematically, the bias is added to the logits generated by the model prior to + sampling. The exact effect will vary per model, but values between -1 and 1 + should decrease or increase likelihood of selection; values like -100 or 100 + should result in a ban or exclusive selection of the relevant token. + + As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token + from being generated. + + logprobs: Include the log probabilities on the `logprobs` most likely output tokens, as + well the chosen tokens. For example, if `logprobs` is 5, the API will return a + list of the 5 most likely tokens. The API will always return the `logprob` of + the sampled token, so there may be up to `logprobs+1` elements in the response. + + The maximum value for `logprobs` is 5. + + max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the + completion. + + The token count of your prompt plus `max_tokens` cannot exceed the model's + context length. + [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) + for counting tokens. + + n: How many completions to generate for each prompt. + + **Note:** Because this parameter generates many completions, it can quickly + consume your token quota. Use carefully and ensure that you have reasonable + settings for `max_tokens` and `stop`. + + presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on + whether they appear in the text so far, increasing the model's likelihood to + talk about new topics. + + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details) + + seed: If specified, our system will make a best effort to sample deterministically, + such that repeated requests with the same `seed` and parameters should return + the same result. + + Determinism is not guaranteed, and you should refer to the `system_fingerprint` + response parameter to monitor changes in the backend. + + stop: Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + + stream: Whether to stream back partial progress. If set, tokens will be sent as + data-only + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` + message. + [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + + suffix: The suffix that comes after a completion of inserted text. + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. + + We generally recommend altering this or `top_p` but not both. + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help OpenAI to monitor + and detect abuse. + [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return self._post( "/completions", body=maybe_transform( @@ -1017,6 +1135,124 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Completion | AsyncStream[Completion]: + """ + Creates a completion for the provided prompt and parameters. + + Args: + model: ID of the model to use. You can use the + [List models](https://platform.openai.com/docs/api-reference/models/list) API to + see all of your available models, or see our + [Model overview](https://platform.openai.com/docs/models/overview) for + descriptions of them. + + prompt: The prompt(s) to generate completions for, encoded as a string, array of + strings, array of tokens, or array of token arrays. + + Note that <|endoftext|> is the document separator that the model sees during + training, so if a prompt is not specified the model will generate as if from the + beginning of a new document. + + best_of: Generates `best_of` completions server-side and returns the "best" (the one with + the highest log probability per token). Results cannot be streamed. + + When used with `n`, `best_of` controls the number of candidate completions and + `n` specifies how many to return – `best_of` must be greater than `n`. + + **Note:** Because this parameter generates many completions, it can quickly + consume your token quota. Use carefully and ensure that you have reasonable + settings for `max_tokens` and `stop`. + + echo: Echo back the prompt in addition to the completion + + frequency_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on their + existing frequency in the text so far, decreasing the model's likelihood to + repeat the same line verbatim. + + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details) + + logit_bias: Modify the likelihood of specified tokens appearing in the completion. + + Accepts a JSON object that maps tokens (specified by their token ID in the GPT + tokenizer) to an associated bias value from -100 to 100. You can use this + [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. + Mathematically, the bias is added to the logits generated by the model prior to + sampling. The exact effect will vary per model, but values between -1 and 1 + should decrease or increase likelihood of selection; values like -100 or 100 + should result in a ban or exclusive selection of the relevant token. + + As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token + from being generated. + + logprobs: Include the log probabilities on the `logprobs` most likely output tokens, as + well the chosen tokens. For example, if `logprobs` is 5, the API will return a + list of the 5 most likely tokens. The API will always return the `logprob` of + the sampled token, so there may be up to `logprobs+1` elements in the response. + + The maximum value for `logprobs` is 5. + + max_tokens: The maximum number of [tokens](/tokenizer) that can be generated in the + completion. + + The token count of your prompt plus `max_tokens` cannot exceed the model's + context length. + [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) + for counting tokens. + + n: How many completions to generate for each prompt. + + **Note:** Because this parameter generates many completions, it can quickly + consume your token quota. Use carefully and ensure that you have reasonable + settings for `max_tokens` and `stop`. + + presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on + whether they appear in the text so far, increasing the model's likelihood to + talk about new topics. + + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details) + + seed: If specified, our system will make a best effort to sample deterministically, + such that repeated requests with the same `seed` and parameters should return + the same result. + + Determinism is not guaranteed, and you should refer to the `system_fingerprint` + response parameter to monitor changes in the backend. + + stop: Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + + stream: Whether to stream back partial progress. If set, tokens will be sent as + data-only + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` + message. + [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + + suffix: The suffix that comes after a completion of inserted text. + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. + + We generally recommend altering this or `top_p` but not both. + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help OpenAI to monitor + and detect abuse. + [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return await self._post( "/completions", body=maybe_transform(