diff --git a/superduperdb/ext/llm/base.py b/superduperdb/ext/llm/base.py index e962027669..233132bf9f 100644 --- a/superduperdb/ext/llm/base.py +++ b/superduperdb/ext/llm/base.py @@ -2,6 +2,7 @@ import asyncio import dataclasses as dc import inspect +import typing from functools import wraps from logging import WARNING, getLogger from typing import Any, Callable, List, Optional, Union @@ -11,6 +12,9 @@ from superduperdb.components.model import _Predictor from superduperdb.ext.utils import format_prompt +if typing.TYPE_CHECKING: + from superduperdb.base.datalayer import Datalayer + # Disable httpx info level logging getLogger("httpx").setLevel(WARNING) @@ -51,8 +55,26 @@ class _BaseLLM(Component, _Predictor, metaclass=abc.ABCMeta): def __post_init__(self): super().__post_init__() self.takes_context = True + self.identifier = self.identifier.replace("/", "-") assert "{input}" in self.prompt_template, "Template must contain {input}" + def to_call(self, X, *args, **kwargs): + raise NotImplementedError + + def post_create(self, db: "Datalayer") -> None: + # TODO: Do not make sense to add this logic here, + # Need a auto DataType to handle this + from superduperdb.backends.ibis.data_backend import IbisDataBackend + from superduperdb.backends.ibis.field_types import dtype + + if isinstance(db.databackend, IbisDataBackend) and self.encoder is None: + self.encoder = dtype('str') + + # since then the `.add` clause is not necessary + output_component = db.databackend.create_model_table_or_collection(self) # type: ignore[arg-type] + if output_component is not None: + db.add(output_component) + @abc.abstractmethod def init(self): ... diff --git a/superduperdb/ext/llm/vllm.py b/superduperdb/ext/llm/vllm.py index d4820ffa75..e6aa9ecdcc 100644 --- a/superduperdb/ext/llm/vllm.py +++ b/superduperdb/ext/llm/vllm.py @@ -39,7 +39,7 @@ def _generate(self, prompt: str, **kwargs) -> str: """ post_data = self.build_post_data(prompt, **kwargs) response = requests.post(self.api_url, json=post_data) - return response.json()["text"] + return response.json()["text"][0] def _batch_generate(self, prompts: List[str], **kwargs: Any) -> List[str]: """ @@ -53,7 +53,7 @@ async def _async_generate(self, session, semaphore, prompt: str, **kwargs) -> st try: async with session.post(self.api_url, json=post_data) as response: response_json = await response.json() - return response_json["text"] + return response_json["text"][0] except aiohttp.ClientError as e: logging.error(f"HTTP request failed: {e}. Prompt: {prompt}") return "" diff --git a/test/unittest/ext/cassettes/llm/openai/test_llm_as_listener_model.yaml b/test/unittest/ext/cassettes/llm/openai/test_llm_as_listener_model.yaml new file mode 100644 index 0000000000..1b169833d6 --- /dev/null +++ b/test/unittest/ext/cassettes/llm/openai/test_llm_as_listener_model.yaml @@ -0,0 +1,1203 @@ +interactions: +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-type: + - application/json + host: + - api.openai.com + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: GET + uri: https://api.openai.com/v1/models + response: + content: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"text-search-babbage-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-4-0613\",\n \"object\": + \"model\",\n \"created\": 1686588896,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"curie-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-4\",\n \"object\": \"model\",\n \"created\": + 1687882411,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-davinci-003\",\n + \ \"object\": \"model\",\n \"created\": 1669599635,\n \"owned_by\": + \"openai-internal\"\n },\n {\n \"id\": \"text-search-babbage-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"babbage\",\n \"object\": + \"model\",\n \"created\": 1649358449,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"babbage-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-3.5-turbo-0613\",\n \"object\": \"model\",\n + \ \"created\": 1686587434,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"text-babbage-001\",\n \"object\": \"model\",\n \"created\": + 1649364043,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-similarity-davinci-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-3.5-turbo\",\n \"object\": + \"model\",\n \"created\": 1677610602,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"davinci-similarity\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"curie-similarity\",\n \"object\": \"model\",\n \"created\": + 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n {\n \"id\": + \"babbage-search-document\",\n \"object\": \"model\",\n \"created\": + 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n {\n \"id\": + \"curie-instruct-beta\",\n \"object\": \"model\",\n \"created\": 1649364042,\n + \ \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-ada-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172507,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-3.5-turbo-0301\",\n \"object\": + \"model\",\n \"created\": 1677649963,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"davinci-instruct-beta\",\n \"object\": \"model\",\n + \ \"created\": 1649364042,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"gpt-3.5-turbo-16k-0613\",\n \"object\": \"model\",\n \"created\": + 1685474247,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"gpt-3.5-turbo-1106\",\n + \ \"object\": \"model\",\n \"created\": 1698959748,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"text-similarity-babbage-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"text-search-davinci-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"babbage-similarity\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-embedding-ada-002\",\n \"object\": + \"model\",\n \"created\": 1671217299,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"davinci-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"text-similarity-curie-001\",\n \"object\": \"model\",\n + \ \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-3.5-turbo-instruct\",\n \"object\": \"model\",\n + \ \"created\": 1692901427,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"text-davinci-001\",\n \"object\": \"model\",\n \"created\": + 1649364042,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-davinci-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"ada-search-document\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada-code-search-code\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"davinci-002\",\n \"object\": \"model\",\n \"created\": + 1692634301,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"gpt-3.5-turbo-instruct-0914\",\n + \ \"object\": \"model\",\n \"created\": 1694122472,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"babbage-002\",\n \"object\": + \"model\",\n \"created\": 1692634615,\n \"owned_by\": \"system\"\n + \ },\n {\n \"id\": \"gpt-4-1106-preview\",\n \"object\": \"model\",\n + \ \"created\": 1698957206,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"gpt-4-vision-preview\",\n \"object\": \"model\",\n \"created\": + 1698894917,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"davinci-search-document\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"curie-search-document\",\n \"object\": + \"model\",\n \"created\": 1651172508,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"babbage-code-search-code\",\n \"object\": + \"model\",\n \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-search-ada-query-001\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-ada-text-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"babbage-code-search-text\",\n \"object\": + \"model\",\n \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-babbage-code-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"ada-code-search-text\",\n \"object\": \"model\",\n + \ \"created\": 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"tts-1-hd\",\n \"object\": \"model\",\n \"created\": + 1699046015,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"text-search-curie-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"text-davinci-002\",\n \"object\": + \"model\",\n \"created\": 1649880484,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"code-search-babbage-text-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada\",\n \"object\": \"model\",\n \"created\": + 1649357491,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-ada-001\",\n + \ \"object\": \"model\",\n \"created\": 1649364042,\n \"owned_by\": + \"openai\"\n },\n {\n \"id\": \"ada-similarity\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-ada-code-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-similarity-ada-001\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-davinci-edit-001\",\n \"object\": \"model\",\n + \ \"created\": 1649809179,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"code-davinci-edit-001\",\n \"object\": \"model\",\n \"created\": + 1649880484,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-curie-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"whisper-1\",\n \"object\": + \"model\",\n \"created\": 1677532384,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"text-curie-001\",\n \"object\": \"model\",\n + \ \"created\": 1649364043,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"curie\",\n \"object\": \"model\",\n \"created\": 1649359874,\n + \ \"owned_by\": \"openai\"\n },\n {\n \"id\": \"tts-1\",\n \"object\": + \"model\",\n \"created\": 1681940951,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"davinci\",\n \"object\": \"model\",\n \"created\": + 1649359874,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"dall-e-2\",\n + \ \"object\": \"model\",\n \"created\": 1698798177,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"gpt-4-0314\",\n \"object\": + \"model\",\n \"created\": 1687882410,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"tts-1-1106\",\n \"object\": \"model\",\n + \ \"created\": 1699053241,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"tts-1-hd-1106\",\n \"object\": \"model\",\n \"created\": + 1699053533,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"gpt-3.5-turbo-16k\",\n + \ \"object\": \"model\",\n \"created\": 1683758102,\n \"owned_by\": + \"openai-internal\"\n }\n ]\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6ee69ee2aa3-LAX + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:59 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=ihYAasdJiIKlStQcf1BRtiPKpqWsuhWWKQO3sGHxiA8-1703841599-1-AUvkGFPuJYTwaH1WrsGBgZ8930mpVGAryUBjSiPIk/ckYZziSSKC7K9KMvtac4HtVOmTIG6ETyxudWwIzS9JEio=; + path=/; expires=Fri, 29-Dec-23 09:49:59 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=BZIfoNNJg56jzoqgrT6vMH2VR3qQlSuKeyLVKc2hWfw-1703841599905-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-processing-ms: + - '96' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-request-id: + - eeb332cdcbef76a84195b526b3ef880c + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+6="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K4FU4Xbj5RMwPg5uRtpx4FU0eL\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841600,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"7\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f58bf0090c-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=q0jpjxcJqFw5yo8N1DTGDheV6jJISyqP_6h5w0NTw3I-1703841601-1-ARbjXHlgjC4q9uIrWp7+k47bseWV9uVPT+ZmCwA9FGfV1iTNI0YHg++jWfAtRDBRHHp3LwcXa+ABM4RjYLC633w=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=r0KbpmosyvS9UUr8IqkjyBWC9bBXetMqntNk.IlobHk-1703841601151-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '168' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9990' + x-ratelimit-remaining-tokens: + - '59745' + x-ratelimit-remaining-tokens_usage_based: + - '59745' + x-ratelimit-reset-requests: + - 1m19.263s + x-ratelimit-reset-tokens: + - 254ms + x-ratelimit-reset-tokens_usage_based: + - 254ms + x-request-id: + - 571657ea7621b9861f6149c70fb6b652 + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K41lyFYVn2bjblCM9wd4ogTAvC\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841600,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"2\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f5abcc7baf-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=wwSSWufH_C7oH9wVWnk7wSr9YLrSOzoza6oB8HCktvs-1703841601-1-AYe/2A2cJWD7183o6nhguvpYroevC7MucS3xST20Xl6RMW8np33ClPiONSLpz+moS5h6ExY5pRAXKs4YxMoLQgo=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=Dd7wxJ_MNAbgcIqyG7Odw_WNfXzaYVOxdU5S4b9D08U-1703841601159-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '170' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9985' + x-ratelimit-remaining-tokens: + - '59436' + x-ratelimit-remaining-tokens_usage_based: + - '59436' + x-ratelimit-reset-requests: + - 2m2.441s + x-ratelimit-reset-tokens: + - 563ms + x-ratelimit-reset-tokens_usage_based: + - 563ms + x-request-id: + - 34d4ceb057afec002e1fa04e1e6c711a + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+3="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K4asetkzcVBpQfeadLzIPhhA9p\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841600,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"4\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f58c8e2eb4-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=wIFH1YMNazCQ.GzqzovOIJWswXTja6qGhgc_mZVmsxE-1703841601-1-AaSjONxNSo2Xhg0lYeP6VwV0BgC29BSKxVQJaNXFvaeF58kf2gsUF4YjZxYfNS9sgmNRd71xB5EA9YO/0Ry98RI=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=ybbsUJU9GVNZRKj_nu.TG_ZIAJS0T7g2gOgH7Puh_Vg-1703841601165-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '202' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9992' + x-ratelimit-remaining-tokens: + - '59875' + x-ratelimit-remaining-tokens_usage_based: + - '59875' + x-ratelimit-reset-requests: + - 1m1.985s + x-ratelimit-reset-tokens: + - 124ms + x-ratelimit-reset-tokens_usage_based: + - 124ms + x-request-id: + - c85ceb71c9250236800816e98c3dd698 + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+9="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K4wxHdRCGN5SSxbBLdiG5GAD53\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841600,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"10\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f57b932b7c-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=T5Ai.xr3GWpJlt2S5KeupsAo3u6oT390w8AGYyMQvYc-1703841601-1-AYIqtjaXFG6CsvfKYHff1MbQ2EXssEVLSAnBgQ57JhxDVCtC+saHY1KoorYahxgW0CFdKyJAZruN5CD5zS8tpqs=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=BPYJws3L3bb1VkRZD.Au6mu9j87ii7eAX3NJtQ8z2ps-1703841601200-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '142' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9993' + x-ratelimit-remaining-tokens: + - '59934' + x-ratelimit-remaining-tokens_usage_based: + - '59934' + x-ratelimit-reset-requests: + - 53.352s + x-ratelimit-reset-tokens: + - 66ms + x-ratelimit-reset-tokens_usage_based: + - 66ms + x-request-id: + - 3d086600da9346a20c7fe47406cd7080 + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+7="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K4z9h5V2iRvUGzUYRCnmGCacQ1\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841600,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"8\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f58fcc7c71-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=IBuaCRfRx_BEtIyo0uGMHBkCnSwaSvWbPTgBLF8Q4Ek-1703841601-1-ASQ1+QZIFShOCzRYMVEeAY58WKdnVTuzUokedRaznhi/aqFgUP08UPSj3lcBNsZQotFrexrrmUBpB2BTXzKK+1A=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=sYjhmpmgQJ.tiC3RRO5n3p_OeCcqNHXalNAXRmnwMTU-1703841601203-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '125' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9989' + x-ratelimit-remaining-tokens: + - '59685' + x-ratelimit-remaining-tokens_usage_based: + - '59685' + x-ratelimit-reset-requests: + - 1m27.896s + x-ratelimit-reset-tokens: + - 314ms + x-ratelimit-reset-tokens_usage_based: + - 314ms + x-request-id: + - b31047642b4344c1a4a5f36d522d1015 + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+4="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K4YkhYkRYLMEuCCc7Ir6Y6Mws2\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841600,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"5\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f58e5f1031-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=FGvq0qiktZAxTeCGJPVXMzGIFq4Doeo1_Gc8oWlMCIA-1703841601-1-AQUUi9gRSXi8rP2Nh3Eqq3qv5IdHuESGMvb82hGEMxCSXl1CK/cOAQQ1Fwb9JUc2RMsUYX/Gj+SePSB8p/oDWJs=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=bhY7JBu6VrVMHvtpM0cqyEquhJGxOd8QG8b0tKLMxG0-1703841601206-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '228' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9987' + x-ratelimit-remaining-tokens: + - '59558' + x-ratelimit-remaining-tokens_usage_based: + - '59558' + x-ratelimit-reset-requests: + - 1m45.172s + x-ratelimit-reset-tokens: + - 441ms + x-ratelimit-reset-tokens_usage_based: + - 441ms + x-request-id: + - e6d26a0b43a1d494816fb949e2cc138c + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+2="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K45myyFUuyRfXMX3x25GG39fIQ\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841600,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"3\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f59a9e2ec0-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=VDyEs09jCz45_gWbhQK4ea.__4RHIB30bVbRIXHpmn0-1703841601-1-AR+z6rRNMpoj6++uqNgAne/KjOh3Yb9kmUpwH533uXiTTQESL1e3PLCFZTiQzTRe1hYRJ7QODBaXxPvr8T69UX8=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=0kNiaBBMISHq2nudnq5n0ey4jRuRkIbVBkSPEhfzwck-1703841601233-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '157' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9988' + x-ratelimit-remaining-tokens: + - '59625' + x-ratelimit-remaining-tokens_usage_based: + - '59625' + x-ratelimit-reset-requests: + - 1m36.53s + x-ratelimit-reset-tokens: + - 374ms + x-ratelimit-reset-tokens_usage_based: + - 374ms + x-request-id: + - edcfdfbdb9e61a89c0b431d90eb91d34 + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+8="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K4RErjToqvHIjA4nAGS12dTqC1\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841600,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"9\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f589072f2e-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=fL8dFJgNwahChl90jvZm9Kr1a2zjyENme47E1GFvu3k-1703841601-1-Aalq9Hwoz0h8ECarrHFIzPI4HzenUDDn7GV6NsQStBfdI6zBe/10ve1Fa12t5kpMwUFfmS/FtWj1Nrq9i8adtpE=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=oWimIY6t5Ph_WEe5J4CL60diUTbLcVRdzasQamHtPf4-1703841601464-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '390' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9991' + x-ratelimit-remaining-tokens: + - '59813' + x-ratelimit-remaining-tokens_usage_based: + - '59813' + x-ratelimit-reset-requests: + - 1m10.62s + x-ratelimit-reset-tokens: + - 186ms + x-ratelimit-reset-tokens_usage_based: + - 186ms + x-request-id: + - 1c8277c4ffb13158b54b0139d8333733 + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+5="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K512utckehvhfwERoBemwo9RgY\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841601,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"6\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f5ab952b81-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=W.fNzM6y4GJhbUGsiDuS6h0Uvjn7GgazrYpwtxeqMfw-1703841601-1-AeBsaNLLaa0jlRAKnPykWURZLDoXkF6uNKmXpmjs7c9NbIg5f2v9Wh8nN+Rcgp9Z7mjSWdMAXCc5ONP7jt6vh3g=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=5chd0DS9t575g4NEJihnGfbmhU1lcnDNbyBNTHljbU4-1703841601467-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '380' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9986' + x-ratelimit-remaining-tokens: + - '59495' + x-ratelimit-remaining-tokens_usage_based: + - '59495' + x-ratelimit-reset-requests: + - 1m53.809s + x-ratelimit-reset-tokens: + - 504ms + x-ratelimit-reset-tokens_usage_based: + - 504ms + x-request-id: + - be0ff892d55a9c87a98cf2c0da763722 + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+0="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K5zrlaqXNRP8ALIRJMoZJhC5u2\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841601,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"1\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6f7ca0b7e71-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:20:01 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=CbMj.ZD3C4J0TdBJYtmfF7ajIxxMVatB0LuCUrS4Ers-1703841601-1-AXYfzqLU7WqSQrjiePPEuBsaAFpianNtpSDzdEFypwW2iWN5XQ4pRc20bvy747uwBvkftHf+0uYWsdY8gp+JQJY=; + path=/; expires=Fri, 29-Dec-23 09:50:01 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=14vA1q5Gxxw1UrUcIiTx0cAomt.XChDyNQhHF_yIxeA-1703841601626-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '179' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9984' + x-ratelimit-remaining-tokens: + - '59716' + x-ratelimit-remaining-tokens_usage_based: + - '59934' + x-ratelimit-reset-requests: + - 2m10.735s + x-ratelimit-reset-tokens: + - 283ms + x-ratelimit-reset-tokens_usage_based: + - 66ms + x-request-id: + - 29f7990dd675aeec1d10d760067eca6f + http_version: HTTP/1.1 + status_code: 200 +version: 1 diff --git a/test/unittest/ext/cassettes/llm/openai/test_predict.yaml b/test/unittest/ext/cassettes/llm/openai/test_predict.yaml new file mode 100644 index 0000000000..46017f8720 --- /dev/null +++ b/test/unittest/ext/cassettes/llm/openai/test_predict.yaml @@ -0,0 +1,984 @@ +interactions: +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-type: + - application/json + host: + - api.openai.com + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: GET + uri: https://api.openai.com/v1/models + response: + content: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"text-search-babbage-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-4-0613\",\n \"object\": + \"model\",\n \"created\": 1686588896,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"curie-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-4\",\n \"object\": \"model\",\n \"created\": + 1687882411,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-davinci-003\",\n + \ \"object\": \"model\",\n \"created\": 1669599635,\n \"owned_by\": + \"openai-internal\"\n },\n {\n \"id\": \"text-search-babbage-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"babbage\",\n \"object\": + \"model\",\n \"created\": 1649358449,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"babbage-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-3.5-turbo-0613\",\n \"object\": \"model\",\n + \ \"created\": 1686587434,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"text-babbage-001\",\n \"object\": \"model\",\n \"created\": + 1649364043,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-similarity-davinci-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-3.5-turbo\",\n \"object\": + \"model\",\n \"created\": 1677610602,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"davinci-similarity\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"curie-similarity\",\n \"object\": \"model\",\n \"created\": + 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n {\n \"id\": + \"babbage-search-document\",\n \"object\": \"model\",\n \"created\": + 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n {\n \"id\": + \"curie-instruct-beta\",\n \"object\": \"model\",\n \"created\": 1649364042,\n + \ \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-ada-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172507,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-3.5-turbo-0301\",\n \"object\": + \"model\",\n \"created\": 1677649963,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"davinci-instruct-beta\",\n \"object\": \"model\",\n + \ \"created\": 1649364042,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"gpt-3.5-turbo-16k-0613\",\n \"object\": \"model\",\n \"created\": + 1685474247,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"gpt-3.5-turbo-1106\",\n + \ \"object\": \"model\",\n \"created\": 1698959748,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"text-similarity-babbage-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"text-search-davinci-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"babbage-similarity\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-embedding-ada-002\",\n \"object\": + \"model\",\n \"created\": 1671217299,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"davinci-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"text-similarity-curie-001\",\n \"object\": \"model\",\n + \ \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-3.5-turbo-instruct\",\n \"object\": \"model\",\n + \ \"created\": 1692901427,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"text-davinci-001\",\n \"object\": \"model\",\n \"created\": + 1649364042,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-davinci-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"ada-search-document\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada-code-search-code\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"davinci-002\",\n \"object\": \"model\",\n \"created\": + 1692634301,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"gpt-3.5-turbo-instruct-0914\",\n + \ \"object\": \"model\",\n \"created\": 1694122472,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"babbage-002\",\n \"object\": + \"model\",\n \"created\": 1692634615,\n \"owned_by\": \"system\"\n + \ },\n {\n \"id\": \"gpt-4-1106-preview\",\n \"object\": \"model\",\n + \ \"created\": 1698957206,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"gpt-4-vision-preview\",\n \"object\": \"model\",\n \"created\": + 1698894917,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"davinci-search-document\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"curie-search-document\",\n \"object\": + \"model\",\n \"created\": 1651172508,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"babbage-code-search-code\",\n \"object\": + \"model\",\n \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-search-ada-query-001\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-ada-text-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"babbage-code-search-text\",\n \"object\": + \"model\",\n \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-babbage-code-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"ada-code-search-text\",\n \"object\": \"model\",\n + \ \"created\": 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"tts-1-hd\",\n \"object\": \"model\",\n \"created\": + 1699046015,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"text-search-curie-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"text-davinci-002\",\n \"object\": + \"model\",\n \"created\": 1649880484,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"code-search-babbage-text-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada\",\n \"object\": \"model\",\n \"created\": + 1649357491,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-ada-001\",\n + \ \"object\": \"model\",\n \"created\": 1649364042,\n \"owned_by\": + \"openai\"\n },\n {\n \"id\": \"ada-similarity\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-ada-code-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-similarity-ada-001\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-davinci-edit-001\",\n \"object\": \"model\",\n + \ \"created\": 1649809179,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"code-davinci-edit-001\",\n \"object\": \"model\",\n \"created\": + 1649880484,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-curie-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"whisper-1\",\n \"object\": + \"model\",\n \"created\": 1677532384,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"text-curie-001\",\n \"object\": \"model\",\n + \ \"created\": 1649364043,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"curie\",\n \"object\": \"model\",\n \"created\": 1649359874,\n + \ \"owned_by\": \"openai\"\n },\n {\n \"id\": \"tts-1\",\n \"object\": + \"model\",\n \"created\": 1681940951,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"davinci\",\n \"object\": \"model\",\n \"created\": + 1649359874,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"dall-e-2\",\n + \ \"object\": \"model\",\n \"created\": 1698798177,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"gpt-4-0314\",\n \"object\": + \"model\",\n \"created\": 1687882410,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"tts-1-1106\",\n \"object\": \"model\",\n + \ \"created\": 1699053241,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"tts-1-hd-1106\",\n \"object\": \"model\",\n \"created\": + 1699053533,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"gpt-3.5-turbo-16k\",\n + \ \"object\": \"model\",\n \"created\": 1683758102,\n \"owned_by\": + \"openai-internal\"\n }\n ]\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6c5bf297d5f-LAX + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:53 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=uIWn2wiRl_hl5eVZrAsv1tpAblKphAzFpgUyV61fg6k-1703841593-1-AdotcWNj3hxm45wG9COqBmGYK2Hnsj1RufmCxOkpVsqMTSTB/0a05qbh6wI3qjE2gPIBE6eoZbNIEzkjp+AiVzE=; + path=/; expires=Fri, 29-Dec-23 09:49:53 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=r8Z14GFB.b96Su6_FHs.hkRP54K9mcmxAGG3_qGtYF8-1703841593402-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-processing-ms: + - '90' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-request-id: + - 72ca8fc8bd845626fc3fd9652395d67b + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + cookie: + - __cf_bm=uIWn2wiRl_hl5eVZrAsv1tpAblKphAzFpgUyV61fg6k-1703841593-1-AdotcWNj3hxm45wG9COqBmGYK2Hnsj1RufmCxOkpVsqMTSTB/0a05qbh6wI3qjE2gPIBE6eoZbNIEzkjp+AiVzE=; + _cfuvid=r8Z14GFB.b96Su6_FHs.hkRP54K9mcmxAGG3_qGtYF8-1703841593402-0-604800000 + host: + - api.openai.com + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3JxeavrtOwPatXQzcQJhwnHxTB9\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841593,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"2\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6c8d91d7d5f-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:54 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '231' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9999' + x-ratelimit-remaining-tokens: + - '59934' + x-ratelimit-remaining-tokens_usage_based: + - '59934' + x-ratelimit-reset-requests: + - 8.64s + x-ratelimit-reset-tokens: + - 66ms + x-ratelimit-reset-tokens_usage_based: + - 66ms + x-request-id: + - 284d9fe3913f1772ec1bf608d2a3b15d + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3Jz8enlPDMYy2IPfEdMLQGXZNZ8\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841595,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"2\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6d09cc12b5a-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:55 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=YI7HsfZz2UjDCibe6c2ouH1omCkAhBrDTm0JXfLysls-1703841595-1-AT8RU69yZtXjS9CrPZanxoaxu5OrcwjtYIeQ4CPuzGDPI2x5N4xTK1sRzR3vmQXsn1DkaxWrytSoS1Ls31cvBWA=; + path=/; expires=Fri, 29-Dec-23 09:49:55 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=g1pJK9rxSq9xNbd54m2nZQ84dCvBrmdxFqkVrfqiIJk-1703841595344-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '155' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9997' + x-ratelimit-remaining-tokens: + - '59892' + x-ratelimit-remaining-tokens_usage_based: + - '59892' + x-ratelimit-reset-requests: + - 24.666s + x-ratelimit-reset-tokens: + - 107ms + x-ratelimit-reset-tokens_usage_based: + - 107ms + x-request-id: + - d94450b409d211c99bcd28599813d70f + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "2+2="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3JzxhG0apMlJE3yUy6rkZuJvUbD\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841595,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"4\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6d098980918-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:55 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=N0F1LFp_MRtlesnwSZutQFbONRZR1NYnqLRcKUNPrjk-1703841595-1-AfRUnkrVzBpHYJHmLogsAc8BlG31sMvtTKIe86IELf07X3kYa/ZO9rocER6pJKuX/YJ4x/8JfgwJEzaqyeBoicc=; + path=/; expires=Fri, 29-Dec-23 09:49:55 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=UgJYgJUn..T9m8yPfK_p.43c30I9PKXI7JszaaSCnPM-1703841595373-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '321' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9998' + x-ratelimit-remaining-tokens: + - '59934' + x-ratelimit-remaining-tokens_usage_based: + - '59934' + x-ratelimit-reset-requests: + - 16.051s + x-ratelimit-reset-tokens: + - 66ms + x-ratelimit-reset-tokens_usage_based: + - 66ms + x-request-id: + - c02210b382d535eb1d546466d4ba96fc + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-type: + - application/json + host: + - api.openai.com + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: GET + uri: https://api.openai.com/v1/models + response: + content: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"text-search-babbage-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-4-0613\",\n \"object\": + \"model\",\n \"created\": 1686588896,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"curie-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-4\",\n \"object\": \"model\",\n \"created\": + 1687882411,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-davinci-003\",\n + \ \"object\": \"model\",\n \"created\": 1669599635,\n \"owned_by\": + \"openai-internal\"\n },\n {\n \"id\": \"text-search-babbage-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"babbage\",\n \"object\": + \"model\",\n \"created\": 1649358449,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"babbage-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-3.5-turbo-0613\",\n \"object\": \"model\",\n + \ \"created\": 1686587434,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"text-babbage-001\",\n \"object\": \"model\",\n \"created\": + 1649364043,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-similarity-davinci-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-3.5-turbo\",\n \"object\": + \"model\",\n \"created\": 1677610602,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"davinci-similarity\",\n \"object\": \"model\",\n + \ \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"curie-similarity\",\n \"object\": \"model\",\n \"created\": + 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n {\n \"id\": + \"babbage-search-document\",\n \"object\": \"model\",\n \"created\": + 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n {\n \"id\": + \"curie-instruct-beta\",\n \"object\": \"model\",\n \"created\": 1649364042,\n + \ \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-ada-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172507,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"gpt-3.5-turbo-0301\",\n \"object\": + \"model\",\n \"created\": 1677649963,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"davinci-instruct-beta\",\n \"object\": \"model\",\n + \ \"created\": 1649364042,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"gpt-3.5-turbo-16k-0613\",\n \"object\": \"model\",\n \"created\": + 1685474247,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"gpt-3.5-turbo-1106\",\n + \ \"object\": \"model\",\n \"created\": 1698959748,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"text-similarity-babbage-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"text-search-davinci-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"babbage-similarity\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-embedding-ada-002\",\n \"object\": + \"model\",\n \"created\": 1671217299,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"davinci-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"text-similarity-curie-001\",\n \"object\": \"model\",\n + \ \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"gpt-3.5-turbo-instruct\",\n \"object\": \"model\",\n + \ \"created\": 1692901427,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"text-davinci-001\",\n \"object\": \"model\",\n \"created\": + 1649364042,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-davinci-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172505,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"ada-search-document\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada-code-search-code\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"davinci-002\",\n \"object\": \"model\",\n \"created\": + 1692634301,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"gpt-3.5-turbo-instruct-0914\",\n + \ \"object\": \"model\",\n \"created\": 1694122472,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"babbage-002\",\n \"object\": + \"model\",\n \"created\": 1692634615,\n \"owned_by\": \"system\"\n + \ },\n {\n \"id\": \"gpt-4-1106-preview\",\n \"object\": \"model\",\n + \ \"created\": 1698957206,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"gpt-4-vision-preview\",\n \"object\": \"model\",\n \"created\": + 1698894917,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"davinci-search-document\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"curie-search-document\",\n \"object\": + \"model\",\n \"created\": 1651172508,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"babbage-code-search-code\",\n \"object\": + \"model\",\n \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-search-ada-query-001\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-ada-text-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"babbage-code-search-text\",\n \"object\": + \"model\",\n \"created\": 1651172509,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-babbage-code-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada-search-query\",\n \"object\": \"model\",\n + \ \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"ada-code-search-text\",\n \"object\": \"model\",\n + \ \"created\": 1651172510,\n \"owned_by\": \"openai-dev\"\n },\n + \ {\n \"id\": \"tts-1-hd\",\n \"object\": \"model\",\n \"created\": + 1699046015,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"text-search-curie-query-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"text-davinci-002\",\n \"object\": + \"model\",\n \"created\": 1649880484,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"code-search-babbage-text-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"ada\",\n \"object\": \"model\",\n \"created\": + 1649357491,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-ada-001\",\n + \ \"object\": \"model\",\n \"created\": 1649364042,\n \"owned_by\": + \"openai\"\n },\n {\n \"id\": \"ada-similarity\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"code-search-ada-code-001\",\n \"object\": + \"model\",\n \"created\": 1651172507,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-similarity-ada-001\",\n \"object\": + \"model\",\n \"created\": 1651172505,\n \"owned_by\": \"openai-dev\"\n + \ },\n {\n \"id\": \"text-davinci-edit-001\",\n \"object\": \"model\",\n + \ \"created\": 1649809179,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"code-davinci-edit-001\",\n \"object\": \"model\",\n \"created\": + 1649880484,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"text-search-curie-doc-001\",\n + \ \"object\": \"model\",\n \"created\": 1651172509,\n \"owned_by\": + \"openai-dev\"\n },\n {\n \"id\": \"whisper-1\",\n \"object\": + \"model\",\n \"created\": 1677532384,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"text-curie-001\",\n \"object\": \"model\",\n + \ \"created\": 1649364043,\n \"owned_by\": \"openai\"\n },\n {\n + \ \"id\": \"curie\",\n \"object\": \"model\",\n \"created\": 1649359874,\n + \ \"owned_by\": \"openai\"\n },\n {\n \"id\": \"tts-1\",\n \"object\": + \"model\",\n \"created\": 1681940951,\n \"owned_by\": \"openai-internal\"\n + \ },\n {\n \"id\": \"davinci\",\n \"object\": \"model\",\n \"created\": + 1649359874,\n \"owned_by\": \"openai\"\n },\n {\n \"id\": \"dall-e-2\",\n + \ \"object\": \"model\",\n \"created\": 1698798177,\n \"owned_by\": + \"system\"\n },\n {\n \"id\": \"gpt-4-0314\",\n \"object\": + \"model\",\n \"created\": 1687882410,\n \"owned_by\": \"openai\"\n + \ },\n {\n \"id\": \"tts-1-1106\",\n \"object\": \"model\",\n + \ \"created\": 1699053241,\n \"owned_by\": \"system\"\n },\n {\n + \ \"id\": \"tts-1-hd-1106\",\n \"object\": \"model\",\n \"created\": + 1699053533,\n \"owned_by\": \"system\"\n },\n {\n \"id\": \"gpt-3.5-turbo-16k\",\n + \ \"object\": \"model\",\n \"created\": 1683758102,\n \"owned_by\": + \"openai-internal\"\n }\n ]\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6d94afb2b5c-LAX + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:56 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=4A_bI2xFTMxKPG9V5j4MZjiJ96IzRz32ztjanZgBldA-1703841596-1-AbraLXjuYlpdvH+km7PVrCWRsgSKprkYgho5PH5rdE3wA9quT4MO0m2xY+l0CxRdKfY141KuAgR9H13K8t4ZKBw=; + path=/; expires=Fri, 29-Dec-23 09:49:56 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=S7kMdf8PReKyfA0kBBZlDDWeDPriVyh0Vi5W81uFgLU-1703841596519-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-processing-ms: + - '104' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-request-id: + - 47881f1d1e071ca44743f1d2014ada0d + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + cookie: + - __cf_bm=4A_bI2xFTMxKPG9V5j4MZjiJ96IzRz32ztjanZgBldA-1703841596-1-AbraLXjuYlpdvH+km7PVrCWRsgSKprkYgho5PH5rdE3wA9quT4MO0m2xY+l0CxRdKfY141KuAgR9H13K8t4ZKBw=; + _cfuvid=S7kMdf8PReKyfA0kBBZlDDWeDPriVyh0Vi5W81uFgLU-1703841596519-0-604800000 + host: + - api.openai.com + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K0lV7MZ90olpaiUAlVjNzNWlw8\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841596,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"2\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6dc3dbf2b5c-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:57 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '193' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9996' + x-ratelimit-remaining-tokens: + - '59934' + x-ratelimit-remaining-tokens_usage_based: + - '59934' + x-ratelimit-reset-requests: + - 31.476s + x-ratelimit-reset-tokens: + - 66ms + x-ratelimit-reset-tokens_usage_based: + - 66ms + x-request-id: + - b76b3f88b8d6570017045c75e93708ce + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "2+2="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K2EcwFn6HDdrtustzEutuPzycZ\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841598,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"4\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6e3d9a37bd4-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:58 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=AGKsIiuSy8ecyIXaptR1DcGqw0xRoQrKUU0KUlmBjik-1703841598-1-ARu5CHKYhYKVPtJjM78tFz3E5dotHR4C2EKZokea9qLA7QPTMHpgMm38ZFdbHZoF6m+DmpiqOuqM7MD+8o9VwAc=; + path=/; expires=Fri, 29-Dec-23 09:49:58 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=q8Tnto5U7k7Xc.VMX.RS2eB6IbElEcMRFISCDM5GxAM-1703841598439-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '200' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9995' + x-ratelimit-remaining-tokens: + - '59934' + x-ratelimit-remaining-tokens_usage_based: + - '59934' + x-ratelimit-reset-requests: + - 38.895s + x-ratelimit-reset-tokens: + - 66ms + x-ratelimit-reset-tokens_usage_based: + - 66ms + x-request-id: + - 437eaec671f34ba2c511dc52da967b1c + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "gpt-3.5-turbo", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '115' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + content: "{\n \"id\": \"chatcmpl-8b3K2FI4rLsJ3CsvOukZbczkVjAbl\",\n \"object\": + \"chat.completion\",\n \"created\": 1703841598,\n \"model\": \"gpt-3.5-turbo-0613\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"2\"\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 11,\n \"completion_tokens\": 1,\n \"total_tokens\": 12\n },\n \"system_fingerprint\": + null\n}\n" + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 83d0f6e3eea4527b-LAX + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:19:58 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=jnk42PN4pSSX.X8mlCqBrsRehd9n0iaIvAddIXovad8-1703841598-1-AQ/nhbp0KdutWGXI6OjsxeOy1i1binEc04vYkJtcAJphJPPsqwBVD2f/dWQaF1EuM2B0tFr6Hz1OUVsz48slAnk=; + path=/; expires=Fri, 29-Dec-23 09:49:58 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=Wc9qZQXyAGSslZ3CL5ijz.SOY7C57AR58_Q7djg3t3s-1703841598477-0-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Transfer-Encoding: + - chunked + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0613 + openai-organization: + - user-vp5fxwabufahnpgnwgptlchk + openai-processing-ms: + - '227' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '60000' + x-ratelimit-limit-tokens_usage_based: + - '60000' + x-ratelimit-remaining-requests: + - '9994' + x-ratelimit-remaining-tokens: + - '59881' + x-ratelimit-remaining-tokens_usage_based: + - '59881' + x-ratelimit-reset-requests: + - 47.521s + x-ratelimit-reset-tokens: + - 118ms + x-ratelimit-reset-tokens_usage_based: + - 118ms + x-request-id: + - ae7984d62ec8b50c4ffa368e70fafc6a + http_version: HTTP/1.1 + status_code: 200 +version: 1 diff --git a/test/unittest/ext/cassettes/llm/vllm/test_llm_as_listener_model_openai.yaml b/test/unittest/ext/cassettes/llm/vllm/test_llm_as_listener_model_openai.yaml new file mode 100644 index 0000000000..6670abef26 --- /dev/null +++ b/test/unittest/ext/cassettes/llm/vllm/test_llm_as_listener_model_openai.yaml @@ -0,0 +1,536 @@ +interactions: +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: GET + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/models + response: + content: '{"object":"list","data":[{"id":"mistralai/Mistral-7B-Instruct-v0.2","object":"model","created":1703841391,"owned_by":"vllm","root":"mistralai/Mistral-7B-Instruct-v0.2","parent":null,"permission":[{"id":"modelperm-86cda14b136041869b037d7e39bf13ec","object":"model_permission","created":1703841391,"allow_create_engine":false,"allow_sampling":true,"allow_logprobs":true,"allow_search_indices":false,"allow_view":true,"allow_fine_tuning":false,"organization":"*","group":null,"is_blocking":false}]}]}' + headers: + Connection: + - close + Content-Length: + - '497' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+2="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-acd684ac7dce497b96dcb2ae1858907a","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The sum of 1 and 2 is 3."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":27,"completion_tokens":13}}' + headers: + Connection: + - close + Content-Length: + - '320' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+5="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-2515100eec694017afc6e3dd0a72a65f","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The sum of 1 and 5 is 6. So, the answer to the expression 1 + 5 is 6."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":43,"completion_tokens":29}}' + headers: + Connection: + - close + Content-Length: + - '365' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+8="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-ca34f396d9264a8cbe813c3bf32052e3","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The sum of 1 and 8 is 9. So the answer to the expression 1 + 8 is 9."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":42,"completion_tokens":28}}' + headers: + Connection: + - close + Content-Length: + - '364' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+6="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-ad6c001a66cf447084cfd60de26dbe1e","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The sum of 1 and 6 is 7. So, the answer to the expression 1 + 6 is 7."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":43,"completion_tokens":29}}' + headers: + Connection: + - close + Content-Length: + - '365' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+7="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-3793039005e44e60a40e377b7ed6c4ff","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The sum of 1 and 7 is 8. So the answer to the expression 1 + 7 is 8."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":42,"completion_tokens":28}}' + headers: + Connection: + - close + Content-Length: + - '364' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+0="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-bbb5b334681340c28c8024b3625aa7e7","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The answer to the expression 1 + 0 is 1. In arithmetic, 0 is the additive identity + for the number 1, meaning that when you add 0 to 1, the result is still 1."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":65,"completion_tokens":51}}' + headers: + Connection: + - close + Content-Length: + - '453' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-65ff5d83185047fa9ce3abe2bd05b2e3","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The answer to the mathematical expression 1 + 1 is 2. This is a basic arithmetic + principle known as addition, where you combine two numbers to get a sum. In + this case, one 1 is added to another 1, resulting in a total of 2."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":74,"completion_tokens":60}}' + headers: + Connection: + - close + Content-Length: + - '519' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+4="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-4e8fb024644a462aa7806fe9ed654701","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The sum of 1 and 4 is 5. So the answer to the expression 1 + 4 is 5. In mathematical + terms, this is called addition. In simple words, when you have one item and + you add four more items to it, you have a total of five items."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":77,"completion_tokens":63}}' + headers: + Connection: + - close + Content-Length: + - '519' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+9="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-61208fa1eab741d8bcb76a87afe719f7","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The sum of 1 and 9 is 10. However, it''s important to note that when performing + arithmetic operations, it''s common to write the answer as the result of the + operation, rather than the sum of the numbers and the operation symbol. So, + the correct answer is 1"},"finish_reason":"length"}],"usage":{"prompt_tokens":14,"total_tokens":78,"completion_tokens":64}}' + headers: + Connection: + - close + Content-Length: + - '552' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+3="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-77b91b8b254b45c3ad064e9591d6eb4c","object":"chat.completion","created":21734,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The sum of 1 and 3 is 4. So the answer to the expression 1 + 3 is 4. This is + a basic arithmetic operation known as addition. In this case, you are adding + one number (1) to another number (3), and the result is the sum of"},"finish_reason":"length"}],"usage":{"prompt_tokens":14,"total_tokens":78,"completion_tokens":64}}' + headers: + Connection: + - close + Content-Length: + - '518' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:30 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +version: 1 diff --git a/test/unittest/ext/cassettes/llm/vllm/test_llm_as_listener_model_openapi.yaml b/test/unittest/ext/cassettes/llm/vllm/test_llm_as_listener_model_openapi.yaml new file mode 100644 index 0000000000..dcbeedc79f --- /dev/null +++ b/test/unittest/ext/cassettes/llm/vllm/test_llm_as_listener_model_openapi.yaml @@ -0,0 +1,229 @@ +interactions: +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+7=8\n\nThis equation is incorrect because the sum of 1 + and 7 is 8, but the equation states that 1 plus 7 equals 8. The correct equation + would be 1 + 7 = 8."]}' + headers: + Content-Length: + - '170' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+5=6\n\nThis equation is incorrect because the sum of 1 + and 5 is actually 6, not 5 as shown in the equation. Therefore, the equation + should be written as 1 + 5 = 6 instead."]}' + headers: + Content-Length: + - '186' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+8=9\n\nThis equation is incorrect because the sum of 1 + and 8 is actually 9, not 8 as shown in the equation. Therefore, the equation + should be written as 1 + 8 = 9 instead."]}' + headers: + Content-Length: + - '186' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+9=10\n\nI''ve been trying to figure out why this is the + case. I''ve tried to think of it as a carry over from the 9 to the 1, but + that doesn''t seem to make sense because the 1 is already in the 1''s place. + I''"]}' + headers: + Content-Length: + - '220' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+6=7\n\nThis is a common misconception, but it''s important + to clarify that the sum of 1 and 6 is not equal to 7. The correct answer is + 7, but only when considering certain specific mathematical contexts, such + as when using certain non-standard number systems or when"]}' + headers: + Content-Length: + - '280' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+1=3\n\nI''ve been trying to figure out how to do this for + a while now. I''ve tried using a switch statement, but that only works for + a limited number of cases. I''ve also tried using an array, but that doesn''t + seem to work either.\n\nHere''s"]}' + headers: + Content-Length: + - '252' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+3=4\n\nThis equation is incorrect because the sum of 1 + and 3 is 4, not 5. The correct equation is 1 + 3 = 4. However, it''s important + to note that the order of numbers in an equation matters, and if we were to + write it as "]}' + headers: + Content-Length: + - '236' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: "{\"text\":[\"1+0=1\\n\\n# 1. \uBB38\uC81C \uC774\uD574\\n\\n# 1.1. + \uBB38\uC81C \uC124\uBA85\\n# \uC815\uC218 num1\uACFC num2\uAC00 \uC8FC\uC5B4\uC9C8 + \uB54C, num1\uC744 num2\uB85C \uB098\uB204\uC5C8\uC744 \uB54C \uBAAB\uC744 + \"]}" + headers: + Content-Length: + - '146' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+4=5\n\nThis is a simple arithmetic equation, but it is + also a statement about the power of the human mind. The equation 1+4=5 may + seem incorrect to most people, but it is a valid equation in a certain context. + In the binary number system, which is used by computers to"]}' + headers: + Content-Length: + - '283' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+2=3\n\nThis is a simple arithmetic equation. The sum of + 1 and 2 is 3.\n\nHowever, in the world of quantum mechanics, things are not + always so straightforward. In quantum mechanics, particles can exist in multiple + states at once, a property known as superposition. This means"]}' + headers: + Content-Length: + - '289' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:28 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +version: 1 diff --git a/test/unittest/ext/cassettes/llm/vllm/test_predict_api.yaml b/test/unittest/ext/cassettes/llm/vllm/test_predict_api.yaml new file mode 100644 index 0000000000..122bf91a26 --- /dev/null +++ b/test/unittest/ext/cassettes/llm/vllm/test_predict_api.yaml @@ -0,0 +1,83 @@ +interactions: +- request: + body: '{"prompt": "1+1=", "n": 1, "temperature": 0.0, "max_tokens": 64, "use_beam_search": + false}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '90' + Content-Type: + - application/json + User-Agent: + - python-requests/2.31.0 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+1=3\n\nI''ve been trying to figure out how to do this for + a while now. I''ve tried using a switch statement, but that only works for + a limited number of cases. I''ve also tried using an array, but that doesn''t + seem to work either.\n\nHere''s"]}' + headers: + content-length: + - '252' + content-type: + - application/json + date: + - Fri, 29 Dec 2023 09:17:23 GMT + server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: '{"text":["1+1=3\n\nI''ve been trying to figure out how to do this for + a while now. I''ve tried using a switch statement, but that only works for + a limited number of cases. I''ve also tried using an array, but that doesn''t + seem to work either.\n\nHere''s"]}' + headers: + Content-Length: + - '252' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:25 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +- request: + body: null + headers: {} + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate + response: + body: + string: "{\"text\":[\"2+2=4\\n\\nThis is a simple mathematical equation. It + is a statement of fact. It is a truth.\\n\\nBut what if it wasn\u2019t? What + if 2+2 didn\u2019t equal 4? What if it equaled 5 or 6 or 100?\\n\\nThis\"]}" + headers: + Content-Length: + - '203' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:17:25 GMT + Server: + - uvicorn + status: + code: 200 + message: OK +version: 1 diff --git a/test/unittest/ext/cassettes/llm/vllm/test_predict_openai.yaml b/test/unittest/ext/cassettes/llm/vllm/test_predict_openai.yaml new file mode 100644 index 0000000000..f33fed46fa --- /dev/null +++ b/test/unittest/ext/cassettes/llm/vllm/test_predict_openai.yaml @@ -0,0 +1,394 @@ +interactions: +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: GET + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/models + response: + content: '{"object":"list","data":[{"id":"mistralai/Mistral-7B-Instruct-v0.2","object":"model","created":1703841378,"owned_by":"vllm","root":"mistralai/Mistral-7B-Instruct-v0.2","parent":null,"permission":[{"id":"modelperm-b3953151a42c439f99d86c1698dc9c62","object":"model_permission","created":1703841378,"allow_create_engine":false,"allow_sampling":true,"allow_logprobs":true,"allow_search_indices":false,"allow_view":true,"allow_fine_tuning":false,"organization":"*","group":null,"is_blocking":false}]}]}' + headers: + Connection: + - close + Content-Length: + - '497' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:17 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-88c9bc6266c84aa9bd2698dca7169dad","object":"chat.completion","created":21722,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The answer to the mathematical expression 1 + 1 is 2. This is a basic arithmetic + principle known as the commutative property of addition, which states that changing + the order of the addends does not change the sum. In this case, 1 + 1 is the + same as 1 +"},"finish_reason":"length"}],"usage":{"prompt_tokens":14,"total_tokens":78,"completion_tokens":64}}' + headers: + Connection: + - close + Content-Length: + - '551' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:18 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "2+2="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-58a5adbf49574817b8e5be89f86e3418","object":"chat.completion","created":21724,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The answer to the mathematical expression 2 + 2 is 4. This is a basic arithmetic + operation where you add two numbers together. In this case, you have the numbers + 2 and 2, and when you add them together, the sum is 4."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":72,"completion_tokens":58}}' + headers: + Connection: + - close + Content-Length: + - '512' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:21 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-ee6f8fddc7404c27b16e9520b893d903","object":"chat.completion","created":21724,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The answer to the mathematical expression 1 + 1 is 2. This is a basic arithmetic + principle known as the commutative property of addition, which states that changing + the order of the addends does not change the sum. In this case, 1 + 1 is the + same as 1 +"},"finish_reason":"length"}],"usage":{"prompt_tokens":14,"total_tokens":78,"completion_tokens":64}}' + headers: + Connection: + - close + Content-Length: + - '551' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:21 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: GET + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/models + response: + content: '{"object":"list","data":[{"id":"mistralai/Mistral-7B-Instruct-v0.2","object":"model","created":1703841384,"owned_by":"vllm","root":"mistralai/Mistral-7B-Instruct-v0.2","parent":null,"permission":[{"id":"modelperm-e4f1666110ea481a92efc9413aab938f","object":"model_permission","created":1703841384,"allow_create_engine":false,"allow_sampling":true,"allow_logprobs":true,"allow_search_indices":false,"allow_view":true,"allow_fine_tuning":false,"organization":"*","group":null,"is_blocking":false}]}]}' + headers: + Connection: + - close + Content-Length: + - '497' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:23 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - OpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-0f03e64d676d414380a990791c3bfcab","object":"chat.completion","created":21728,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The answer to the mathematical expression 1 + 1 is 2. This is a basic arithmetic + principle known as the commutative property of addition, which states that changing + the order of the addends does not change the sum. In this case, 1 + 1 is the + same as 1 +"},"finish_reason":"length"}],"usage":{"prompt_tokens":14,"total_tokens":78,"completion_tokens":64}}' + headers: + Connection: + - close + Content-Length: + - '551' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:24 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "2+2="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-edd0d6392b664186a1442c102da5156e","object":"chat.completion","created":21730,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The answer to the mathematical expression 2 + 2 is 4. This is a basic arithmetic + operation where you add two numbers together. In this case, you have the numbers + 2 and 2, and when you add them together, the sum is 4."},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"total_tokens":72,"completion_tokens":58}}' + headers: + Connection: + - close + Content-Length: + - '512' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:27 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +- request: + body: '{"messages": [{"role": "user", "content": "1+1="}], "model": "mistralai/Mistral-7B-Instruct-v0.2", + "max_tokens": 64, "temperature": 0.0}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '136' + content-type: + - application/json + host: + - ec2-54-208-130-192.compute-1.amazonaws.com:8000 + user-agent: + - AsyncOpenAI/Python 1.1.2 + x-stainless-arch: + - arm64 + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.1.2 + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.10.13 + method: POST + uri: http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1/chat/completions + response: + content: '{"id":"cmpl-c54282ee747b4f10b6037414a8918c6f","object":"chat.completion","created":21730,"model":"mistralai/Mistral-7B-Instruct-v0.2","choices":[{"index":0,"message":{"role":"assistant","content":" + The answer to the mathematical expression 1 + 1 is 2. This is a basic arithmetic + principle known as the commutative property of addition, which states that changing + the order of the addends does not change the sum. In this case, 1 + 1 is the + same as 1 +"},"finish_reason":"length"}],"usage":{"prompt_tokens":14,"total_tokens":78,"completion_tokens":64}}' + headers: + Connection: + - close + Content-Length: + - '551' + Content-Type: + - application/json + Date: + - Fri, 29 Dec 2023 09:16:27 GMT + Server: + - uvicorn + http_version: HTTP/1.1 + status_code: 200 +version: 1 diff --git a/test/unittest/ext/llm/__init__.py b/test/unittest/ext/llm/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/unittest/ext/llm/test_openai.py b/test/unittest/ext/llm/test_openai.py new file mode 100644 index 0000000000..809cf2ee25 --- /dev/null +++ b/test/unittest/ext/llm/test_openai.py @@ -0,0 +1,39 @@ +from test.db_config import DBConfig +from test.unittest.ext.llm.utils import check_llm_as_listener_model, check_predict + +import pytest +import vcr + +from superduperdb.ext.llm.openai import OpenAI + +CASSETTE_DIR = "test/unittest/ext/cassettes/llm/openai" + + +@vcr.use_cassette( + f"{CASSETTE_DIR}/test_predict.yaml", + filter_headers=["authorization"], + record_on_exception=False, + ignore_localhost=True, +) +@pytest.mark.parametrize( + "db", [DBConfig.mongodb_empty, DBConfig.sqldb_empty], indirect=True +) +def test_predict(db): + """Test chat.""" + check_predict(db, OpenAI(model_name="gpt-3.5-turbo")) + check_predict( + db, OpenAI(identifier="chat-llm", model_name="gpt-3.5-turbo", chat=True) + ) + + +@vcr.use_cassette( + f"{CASSETTE_DIR}/test_llm_as_listener_model.yaml", + filter_headers=["authorization"], + record_on_exception=False, + ignore_localhost=True, +) +@pytest.mark.parametrize( + "db", [DBConfig.mongodb_empty, DBConfig.sqldb_empty], indirect=True +) +def test_llm_as_listener_model(db): + check_llm_as_listener_model(db, OpenAI(model_name="gpt-3.5-turbo")) diff --git a/test/unittest/ext/llm/test_vllm.py b/test/unittest/ext/llm/test_vllm.py new file mode 100644 index 0000000000..45a1d829f1 --- /dev/null +++ b/test/unittest/ext/llm/test_vllm.py @@ -0,0 +1,79 @@ +from test.db_config import DBConfig +from test.unittest.ext.llm.utils import check_llm_as_listener_model, check_predict + +import pytest +import vcr + +from superduperdb.ext.llm.vllm import VllmAPI, VllmOpenAI + +CASSETTE_DIR = "test/unittest/ext/cassettes/llm/vllm" + +model_name = "mistralai/Mistral-7B-Instruct-v0.2" +openai_api_base = "http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/v1" +api_url = "http://ec2-54-208-130-192.compute-1.amazonaws.com:8000/generate" + + +@vcr.use_cassette( + f"{CASSETTE_DIR}/test_predict_openai.yaml", + filter_headers=["authorization"], + record_on_exception=False, + ignore_localhost=True, +) +@pytest.mark.parametrize( + "db", [DBConfig.mongodb_empty, DBConfig.sqldb_empty], indirect=True +) +def test_predict_openai(db): + """Test chat.""" + check_predict( + db, VllmOpenAI(model_name=model_name, openai_api_base=openai_api_base) + ) + check_predict( + db, + VllmOpenAI( + identifier="chat-llm", + model_name=model_name, + openai_api_base=openai_api_base, + chat=True, + ), + ) + + +@vcr.use_cassette( + f"{CASSETTE_DIR}/test_llm_as_listener_model_openai.yaml", + filter_headers=["authorization"], + record_on_exception=False, + ignore_localhost=True, +) +@pytest.mark.parametrize("db", [DBConfig.sqldb_empty], indirect=True) +def test_llm_as_listener_model_openai(db): + check_llm_as_listener_model( + db, + VllmOpenAI(model_name=model_name, openai_api_base=openai_api_base), + ) + + +@vcr.use_cassette( + f"{CASSETTE_DIR}/test_predict_api.yaml", + filter_headers=["authorization"], + record_on_exception=False, + ignore_localhost=True, +) +@pytest.mark.parametrize( + "db", [DBConfig.mongodb_empty, DBConfig.sqldb_empty], indirect=True +) +def test_predict_api(db): + """Test chat.""" + check_predict(db, VllmAPI(identifier="llm", api_url=api_url)) + + +@vcr.use_cassette( + f"{CASSETTE_DIR}/test_llm_as_listener_model_openapi.yaml", + filter_headers=["authorization"], + record_on_exception=False, + ignore_localhost=True, +) +@pytest.mark.parametrize( + "db", [DBConfig.mongodb_empty, DBConfig.sqldb_empty], indirect=True +) +def test_llm_as_listener_model_openapi(db): + check_llm_as_listener_model(db, VllmAPI(identifier="llm", api_url=api_url)) diff --git a/test/unittest/ext/llm/utils.py b/test/unittest/ext/llm/utils.py new file mode 100644 index 0000000000..6d16194809 --- /dev/null +++ b/test/unittest/ext/llm/utils.py @@ -0,0 +1,62 @@ +""" +LLM model test cases. +All the llm model can use the check_xxx func to test the intergration with db. +""" + +from superduperdb.backends.ibis.field_types import dtype +from superduperdb.backends.ibis.query import Schema, Table +from superduperdb.backends.mongodb.data_backend import MongoDataBackend +from superduperdb.backends.mongodb.query import Collection +from superduperdb.base.document import Document +from superduperdb.components.listener import Listener + + +def check_predict(db, llm): + """Test chat.""" + db.add(llm) + result = db.predict(llm.identifier, "1+1=")[0].content + assert isinstance(result, str) + + results = db.predict(llm.identifier, ["1+1=", "2+2="])[0].content + + assert isinstance(results, list) + assert len(results) == 2 + + +def check_llm_as_listener_model(db, llm): + collection_name = "question" + datas = [Document({"question": f"1+{i}=", "id": str(i)}) for i in range(10)] + if isinstance(db.databackend, MongoDataBackend): + db.execute(Collection(collection_name).insert_many(datas)) + output_select = select = Collection(collection_name).find() + else: + schema = Schema( + identifier=collection_name, + fields={ + "id": dtype("str"), + "question": dtype("str"), + }, + ) + table = Table(identifier=collection_name, schema=schema) + db.add(table) + db.execute(table.insert(datas)) + select = table.select("id", "question") + output_select = table.select("id", "question").outputs(question=llm.identifier) + + db.add(llm) + + db.add( + Listener( + select=select, + key="question", + model=llm.identifier, + ) + ) + + results = db.execute(output_select) + for result in results: + try: + output = result.outputs("question", llm.identifier) + except KeyError: + output = result.unpack()[f'_outputs.question.{llm.identifier}.0'] + assert isinstance(output, str) diff --git a/test/unittest/ext/test_openai.py b/test/unittest/ext/test_openai.py index b0db7ecf35..f313c5612a 100644 --- a/test/unittest/ext/test_openai.py +++ b/test/unittest/ext/test_openai.py @@ -58,7 +58,6 @@ def open_ai_with_rhymes(db, monkeypatch): db.remove('model', 'text-embedding-ada-002', force=True) -# TODO: Mock OpenAI API instead of using VCR in unittest @vcr.use_cassette( f'{CASSETTE_DIR}/test_retrieve_with_similar_context.yaml', filter_headers=['authorization'], diff --git a/test/unittest/test_quality.py b/test/unittest/test_quality.py index fbc08c9381..aba952c884 100644 --- a/test/unittest/test_quality.py +++ b/test/unittest/test_quality.py @@ -19,7 +19,7 @@ ALLOWABLE_DEFECTS = { 'cast': 16, # Try to keep this down 'noqa': 4, # This should never change - 'type_ignore': 32, # This should only ever increase in obscure edge cases + 'type_ignore': 33, # This should only ever increase in obscure edge cases }