Skip to content

Commit

Permalink
chore: regenerate schemas and cassets
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas2D committed Mar 8, 2024
1 parent bad9346 commit f8b7cbf
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 106 deletions.
22 changes: 12 additions & 10 deletions src/genai/schema/_api.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# generated by datamodel-codegen:
# filename: 2024-03-07_openapi_schema
# filename: 2024-03-08_openapi_schema

from __future__ import annotations

from datetime import date
from enum import Enum
from typing import Any, Literal, Optional, Union

import deprecated
from pydantic import AwareDatetime, Field, RootModel

from genai._types import ApiBaseModel
Expand Down Expand Up @@ -758,23 +759,23 @@ class _PromptRetrieveParametersQuery(ApiBaseModel):
context_window_min: Optional[int] = None
context_window_max: Optional[int] = None
folder_id: Optional[str] = None
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class _PromptCreateParametersQuery(ApiBaseModel):
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class _PromptIdDeleteParametersQuery(ApiBaseModel):
version: Literal["2023-11-22"] = "2023-11-22"


class _PromptIdRetrieveParametersQuery(ApiBaseModel):
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class _PromptIdPatchParametersQuery(ApiBaseModel):
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class _PromptIdPatchRequest(ApiBaseModel):
Expand All @@ -784,7 +785,7 @@ class _PromptIdPatchRequest(ApiBaseModel):


class _PromptIdUpdateParametersQuery(ApiBaseModel):
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class _RequestRetrieveParametersQuery(ApiBaseModel):
Expand All @@ -805,7 +806,7 @@ class _RequestChatConversationIdDeleteParametersQuery(ApiBaseModel):


class _RequestChatConversationIdRetrieveParametersQuery(ApiBaseModel):
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class _RequestIdDeleteParametersQuery(ApiBaseModel):
Expand Down Expand Up @@ -887,19 +888,19 @@ class TaskRetrieveResponse(ApiBaseModel):


class _TextChatCreateParametersQuery(ApiBaseModel):
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class _TextChatOutputCreateParametersQuery(ApiBaseModel):
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class TextChatOutputCreateResponse(ApiBaseModel):
result: str


class _TextChatStreamCreateParametersQuery(ApiBaseModel):
version: Literal["2024-03-07"] = "2024-03-07"
version: Literal["2024-03-08"] = "2024-03-08"


class _TextEmbeddingCreateParametersQuery(ApiBaseModel):
Expand Down Expand Up @@ -1115,6 +1116,7 @@ class BaseMessage(ApiBaseModel):
def file_ids(self) -> Optional[list[str]]:
return [file.id for file in self.files] if self.files is not None else None


class BaseTokens(ApiBaseModel):
logprob: Optional[Union[float, str]] = None
rank: Optional[int] = None
Expand Down
18 changes: 9 additions & 9 deletions src/genai/schema/_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ class ModelIdRetrieveEndpoint(ApiEndpoint):
class PromptRetrieveEndpoint(ApiEndpoint):
path: str = "/v2/prompts"
method: str = "GET"
version: str = "2024-03-07"
version: str = "2024-03-08"


class PromptCreateEndpoint(ApiEndpoint):
path: str = "/v2/prompts"
method: str = "POST"
version: str = "2024-03-07"
version: str = "2024-03-08"


class PromptIdDeleteEndpoint(ApiEndpoint):
Expand All @@ -141,19 +141,19 @@ class PromptIdDeleteEndpoint(ApiEndpoint):
class PromptIdRetrieveEndpoint(ApiEndpoint):
path: str = "/v2/prompts/{id}"
method: str = "GET"
version: str = "2024-03-07"
version: str = "2024-03-08"


class PromptIdPatchEndpoint(ApiEndpoint):
path: str = "/v2/prompts/{id}"
method: str = "PATCH"
version: str = "2024-03-07"
version: str = "2024-03-08"


class PromptIdUpdateEndpoint(ApiEndpoint):
path: str = "/v2/prompts/{id}"
method: str = "PUT"
version: str = "2024-03-07"
version: str = "2024-03-08"


class RequestRetrieveEndpoint(ApiEndpoint):
Expand All @@ -171,7 +171,7 @@ class RequestChatConversationIdDeleteEndpoint(ApiEndpoint):
class RequestChatConversationIdRetrieveEndpoint(ApiEndpoint):
path: str = "/v2/requests/chat/{conversation_id}"
method: str = "GET"
version: str = "2024-03-07"
version: str = "2024-03-08"


class RequestIdDeleteEndpoint(ApiEndpoint):
Expand Down Expand Up @@ -243,19 +243,19 @@ class TaskRetrieveEndpoint(ApiEndpoint):
class TextChatCreateEndpoint(ApiEndpoint):
path: str = "/v2/text/chat"
method: str = "POST"
version: str = "2024-03-07"
version: str = "2024-03-08"


class TextChatOutputCreateEndpoint(ApiEndpoint):
path: str = "/v2/text/chat/output"
method: str = "POST"
version: str = "2024-03-07"
version: str = "2024-03-08"


class TextChatStreamCreateEndpoint(ApiEndpoint):
path: str = "/v2/text/chat_stream"
method: str = "POST"
version: str = "2024-03-07"
version: str = "2024-03-08"


class TextEmbeddingCreateEndpoint(ApiEndpoint):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ interactions:
content-type:
- application/json
method: POST
uri: https://api.com/v2/text/chat?version=2024-03-07
uri: https://api.com/v2/text/chat?version=2024-03-08
response:
body:
string: '{"id":"bff5b848-58ba-4e57-a992-bb87e5260907","model_id":"meta-llama/llama-2-70b-chat","created_at":"2024-03-07T20:36:50.483Z","results":[{"generated_text":" NLP
stands for Natural Language Processing, which is a subfield of artificial
intelligence (AI","generated_token_count":20,"input_token_count":160,"stop_reason":"max_tokens","seed":849980025}],"conversation_id":"ad33c6da-2eb9-4b94-9fdb-74159787cd7b"}'
string: '{"id":"9592661d-c493-41b2-a620-0212b44cf99f","model_id":"meta-llama/llama-2-70b-chat","created_at":"2024-03-08T10:10:56.768Z","results":[{"generated_text":" NLP
(Natural Language Processing) is a subfield of artificial intelligence that
deals","generated_token_count":20,"input_token_count":160,"stop_reason":"max_tokens","seed":1977231784}],"conversation_id":"ff7370ed-d9d9-4140-a232-64a9a46f3149"}'
headers:
Connection:
- keep-alive
Date:
- Thu, 07 Mar 2024 20:36:50 GMT
- Fri, 08 Mar 2024 10:10:56 GMT
Keep-Alive:
- timeout=72
content-length:
- '408'
- '400'
content-type:
- application/json; charset=utf-8
content-version:
- '2024-03-07'
- '2024-03-08'
vary:
- accept-encoding
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@ interactions:
content-type:
- application/json
method: POST
uri: https://api.com/v2/text/chat?version=2024-03-07
uri: https://api.com/v2/text/chat?version=2024-03-08
response:
body:
string: '{"id":"3b81c8d5-03e3-4163-ad42-03b7b3e334dc","model_id":"meta-llama/llama-2-70b-chat","created_at":"2024-03-07T20:36:48.611Z","results":[{"generated_text":" NLP
stands for Natural Language Processing, which is a subfield of artificial
intelligence (AI","generated_token_count":20,"input_token_count":160,"stop_reason":"max_tokens","seed":2807329282}],"conversation_id":"c7c2f0d2-e101-4edd-8ada-2a8161b949ee"}'
string: '{"id":"3f18b293-c165-4c41-a621-3d95eddc79ad","model_id":"meta-llama/llama-2-70b-chat","created_at":"2024-03-08T10:10:55.181Z","results":[{"generated_text":" NLP
(Natural Language Processing) is a subfield of artificial intelligence (AI)","generated_token_count":20,"input_token_count":160,"stop_reason":"max_tokens","seed":4249717828}],"conversation_id":"fb0a5b46-0f0b-4a3e-ad2e-f555e3f66dee"}'
headers:
Connection:
- keep-alive
Date:
- Thu, 07 Mar 2024 20:36:48 GMT
- Fri, 08 Mar 2024 10:10:55 GMT
Keep-Alive:
- timeout=72
content-length:
- '409'
- '394'
content-type:
- application/json; charset=utf-8
content-version:
- '2024-03-07'
- '2024-03-08'
vary:
- accept-encoding
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@ interactions:
content-type:
- application/json
method: POST
uri: https://api.com/v2/text/chat?version=2024-03-07
uri: https://api.com/v2/text/chat?version=2024-03-08
response:
body:
string: '{"id":"6f50b684-9cc2-416b-9787-f3323d8cf04c","model_id":"google/flan-ul2","created_at":"2024-03-07T20:36:52.200Z","results":[{"generated_text":"Neuro-linguistic
programming started in the 1970s and has been improved upon for accuracy until
present.","generated_token_count":20,"input_token_count":130,"stop_reason":"eos_token","seed":2268274874}],"conversation_id":"955f726f-8365-466c-896b-638316fed9b6"}'
string: '{"id":"f13b63bb-5ed9-487d-8645-37a13013eb31","model_id":"google/flan-ul2","created_at":"2024-03-08T10:11:01.143Z","results":[{"generated_text":"The
acronym is for Neuro-Linguistic Programming. Basically, it is a","generated_token_count":20,"input_token_count":130,"stop_reason":"max_tokens","seed":2852319478}],"conversation_id":"d6bf8ef4-73e6-410c-8271-aa3f03d56695"}'
headers:
Connection:
- keep-alive
Date:
- Thu, 07 Mar 2024 20:36:52 GMT
- Fri, 08 Mar 2024 10:11:01 GMT
Keep-Alive:
- timeout=72
content-length:
- '404'
- '368'
content-type:
- application/json; charset=utf-8
content-version:
- '2024-03-07'
- '2024-03-08'
vary:
- accept-encoding
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ interactions:
content-type:
- application/json
method: POST
uri: https://api.com/v2/prompts?version=2024-03-07
uri: https://api.com/v2/prompts?version=2024-03-08
response:
body:
string: '{"result":{"id":"vCZvuCZtZDgwJlrb","name":"My test prompt","data":{"meal":"goulash","author":"Shakespeare"},"input":"Write
the recipe for {{meal}} in the style of {{author}}","model_id":"google/flan-t5-xl","moderations":{},"created_at":"2024-03-07T20:39:11.000Z","updated_at":"2024-03-07T20:39:11.000Z","type":"private","public":false,"metadata":{"keywords":["meal","author"]},"tags":[],"author":{"id":453,"first_name":"Tomas","last_name":"Dvorak"},"usage_count":0}}'
string: '{"result":{"id":"z3zdiD5b9UWISxOT","name":"My test prompt","data":{"meal":"goulash","author":"Shakespeare"},"input":"Write
the recipe for {{meal}} in the style of {{author}}","model_id":"google/flan-t5-xl","moderations":{},"created_at":"2024-03-08T10:11:03.000Z","updated_at":"2024-03-08T10:11:03.000Z","type":"private","public":false,"metadata":{"keywords":["meal","author"]},"tags":[],"author":{"id":453,"first_name":"Tomas","last_name":"Dvorak"},"usage_count":0}}'
headers:
Connection:
- keep-alive
Date:
- Thu, 07 Mar 2024 20:39:11 GMT
- Fri, 08 Mar 2024 10:11:02 GMT
Keep-Alive:
- timeout=72
content-length:
- '466'
content-type:
- application/json; charset=utf-8
content-version:
- '2024-03-07'
- '2024-03-08'
vary:
- accept-encoding
x-ratelimit-limit:
Expand All @@ -54,24 +54,24 @@ interactions:
connection:
- keep-alive
method: GET
uri: https://api.com/v2/prompts/vCZvuCZtZDgwJlrb?version=2024-03-07
uri: https://api.com/v2/prompts/z3zdiD5b9UWISxOT?version=2024-03-08
response:
body:
string: '{"result":{"id":"vCZvuCZtZDgwJlrb","name":"My test prompt","data":{"meal":"goulash","author":"Shakespeare"},"input":"Write
the recipe for {{meal}} in the style of {{author}}","model_id":"google/flan-t5-xl","moderations":{},"created_at":"2024-03-07T20:39:11.000Z","updated_at":"2024-03-07T20:39:11.000Z","type":"private","public":false,"metadata":{"keywords":["meal","author"]},"tags":[],"author":{"id":453,"first_name":"Tomas","last_name":"Dvorak"},"usage_count":0}}'
string: '{"result":{"id":"z3zdiD5b9UWISxOT","name":"My test prompt","data":{"meal":"goulash","author":"Shakespeare"},"input":"Write
the recipe for {{meal}} in the style of {{author}}","model_id":"google/flan-t5-xl","moderations":{},"created_at":"2024-03-08T10:11:03.000Z","updated_at":"2024-03-08T10:11:03.000Z","type":"private","public":false,"metadata":{"keywords":["meal","author"]},"tags":[],"author":{"id":453,"first_name":"Tomas","last_name":"Dvorak"},"usage_count":0}}'
headers:
Connection:
- keep-alive
Date:
- Thu, 07 Mar 2024 20:39:12 GMT
- Fri, 08 Mar 2024 10:11:03 GMT
Keep-Alive:
- timeout=72
content-length:
- '466'
content-type:
- application/json; charset=utf-8
content-version:
- '2024-03-07'
- '2024-03-08'
vary:
- accept-encoding
x-ratelimit-limit:
Expand All @@ -86,7 +86,7 @@ interactions:
- request:
body: '{"parameters": {"return_options": {"generated_tokens": false, "input_text":
true, "input_tokens": false, "token_logprobs": false, "token_ranks": false}},
"prompt_id": "vCZvuCZtZDgwJlrb"}'
"prompt_id": "z3zdiD5b9UWISxOT"}'
headers:
accept:
- '*/*'
Expand All @@ -102,18 +102,18 @@ interactions:
uri: https://api.com/v2/text/generation?version=2024-01-10
response:
body:
string: '{"id":"ecc40ac1-a6a8-4362-8d68-3c792ead185f","model_id":"google/flan-t5-xl","created_at":"2024-03-07T20:39:13.793Z","results":[{"input_text":"Write
the recipe for goulash in the style of Shakespeare","generated_text":"]]]
>Prepare beef 2, carrots 1 onion 1 teaspoon salt, 1.5 tablespoon","generated_token_count":20,"input_token_count":13,"stop_reason":"max_tokens","seed":2802486288}]}'
string: '{"id":"3fe1a514-7184-4c36-9156-c693ca351201","model_id":"google/flan-t5-xl","created_at":"2024-03-08T10:11:04.673Z","results":[{"input_text":"Write
the recipe for goulash in the style of Shakespeare","generated_text":"Of course.
With the Lamb here, you might as well go quick and easy with Lamb Cutlets","generated_token_count":20,"input_token_count":13,"stop_reason":"max_tokens","seed":348397510}]}'
headers:
Connection:
- keep-alive
Date:
- Thu, 07 Mar 2024 20:39:13 GMT
- Fri, 08 Mar 2024 10:11:04 GMT
Keep-Alive:
- timeout=72
content-length:
- '385'
- '400'
content-type:
- application/json; charset=utf-8
content-version:
Expand All @@ -133,15 +133,15 @@ interactions:
connection:
- keep-alive
method: DELETE
uri: https://api.com/v2/prompts/vCZvuCZtZDgwJlrb?version=2023-11-22
uri: https://api.com/v2/prompts/z3zdiD5b9UWISxOT?version=2023-11-22
response:
body:
string: ''
headers:
Connection:
- keep-alive
Date:
- Thu, 07 Mar 2024 20:39:14 GMT
- Fri, 08 Mar 2024 10:11:08 GMT
Keep-Alive:
- timeout=72
content-version:
Expand All @@ -165,23 +165,23 @@ interactions:
connection:
- keep-alive
method: GET
uri: https://api.com/v2/prompts?search=My%20test%20prompt&model_id=google%2Fflan-t5-xl&version=2024-03-07
uri: https://api.com/v2/prompts?search=My%20test%20prompt&model_id=google%2Fflan-t5-xl&version=2024-03-08
response:
body:
string: '{"results":[],"total_count":0}'
headers:
Connection:
- keep-alive
Date:
- Thu, 07 Mar 2024 20:39:15 GMT
- Fri, 08 Mar 2024 10:11:09 GMT
Keep-Alive:
- timeout=72
content-length:
- '30'
content-type:
- application/json; charset=utf-8
content-version:
- '2024-03-07'
- '2024-03-08'
vary:
- accept-encoding
x-ratelimit-limit:
Expand Down
Loading

0 comments on commit f8b7cbf

Please sign in to comment.