Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2FTogetherAI-1677223d9bf95220f0e49c6c62130fc30a936ffc69f2a507a68b714ab6099e8f.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2FTogetherAI-5e0a37829859a7e57d29be0ae29e5a1094a9f5ab1ca47c8ed224b77f74a3ccad.yml
150 changes: 81 additions & 69 deletions src/together/resources/chat/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Dict, List, Iterable
from typing import Dict, List, Union, Iterable
from typing_extensions import Literal, overload

import httpx
Expand Down Expand Up @@ -56,7 +56,16 @@ def create(
self,
*,
messages: Iterable[completion_create_params.Message],
model: str,
model: Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -92,16 +101,6 @@ def create(

model: The name of the model to query.

Popular models:

- meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo
- Qwen/Qwen2.5-7B-Instruct-Turbo
- Qwen/Qwen2.5-72B-Instruct-Turbo

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models)

echo: If true, the response will contain the prompt. Can be used with `logprobs` to
return prompt logprobs.

Expand Down Expand Up @@ -180,7 +179,16 @@ def create(
self,
*,
messages: Iterable[completion_create_params.Message],
model: str,
model: Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
],
stream: Literal[True],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -216,16 +224,6 @@ def create(

model: The name of the model to query.

Popular models:

- meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo
- Qwen/Qwen2.5-7B-Instruct-Turbo
- Qwen/Qwen2.5-72B-Instruct-Turbo

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models)

stream: If true, stream tokens as Server-Sent Events as the model generates them instead
of waiting for the full model response. The stream terminates with
`data: [DONE]`. If false, return a single JSON object containing the results.
Expand Down Expand Up @@ -304,7 +302,16 @@ def create(
self,
*,
messages: Iterable[completion_create_params.Message],
model: str,
model: Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
],
stream: bool,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -340,16 +347,6 @@ def create(

model: The name of the model to query.

Popular models:

- meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo
- Qwen/Qwen2.5-7B-Instruct-Turbo
- Qwen/Qwen2.5-72B-Instruct-Turbo

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models)

stream: If true, stream tokens as Server-Sent Events as the model generates them instead
of waiting for the full model response. The stream terminates with
`data: [DONE]`. If false, return a single JSON object containing the results.
Expand Down Expand Up @@ -428,7 +425,16 @@ def create(
self,
*,
messages: Iterable[completion_create_params.Message],
model: str,
model: Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -519,7 +525,16 @@ async def create(
self,
*,
messages: Iterable[completion_create_params.Message],
model: str,
model: Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -555,16 +570,6 @@ async def create(

model: The name of the model to query.

Popular models:

- meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo
- Qwen/Qwen2.5-7B-Instruct-Turbo
- Qwen/Qwen2.5-72B-Instruct-Turbo

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models)

echo: If true, the response will contain the prompt. Can be used with `logprobs` to
return prompt logprobs.

Expand Down Expand Up @@ -643,7 +648,16 @@ async def create(
self,
*,
messages: Iterable[completion_create_params.Message],
model: str,
model: Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
],
stream: Literal[True],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -679,16 +693,6 @@ async def create(

model: The name of the model to query.

Popular models:

- meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo
- Qwen/Qwen2.5-7B-Instruct-Turbo
- Qwen/Qwen2.5-72B-Instruct-Turbo

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models)

stream: If true, stream tokens as Server-Sent Events as the model generates them instead
of waiting for the full model response. The stream terminates with
`data: [DONE]`. If false, return a single JSON object containing the results.
Expand Down Expand Up @@ -767,7 +771,16 @@ async def create(
self,
*,
messages: Iterable[completion_create_params.Message],
model: str,
model: Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
],
stream: bool,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -803,16 +816,6 @@ async def create(

model: The name of the model to query.

Popular models:

- meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo
- Qwen/Qwen2.5-7B-Instruct-Turbo
- Qwen/Qwen2.5-72B-Instruct-Turbo

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models)

stream: If true, stream tokens as Server-Sent Events as the model generates them instead
of waiting for the full model response. The stream terminates with
`data: [DONE]`. If false, return a single JSON object containing the results.
Expand Down Expand Up @@ -891,7 +894,16 @@ async def create(
self,
*,
messages: Iterable[completion_create_params.Message],
model: str,
model: Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
Expand Down
26 changes: 13 additions & 13 deletions src/together/types/chat/completion_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ class CompletionCreateParamsBase(TypedDict, total=False):
messages: Required[Iterable[Message]]
"""A list of messages comprising the conversation so far."""

model: Required[str]
"""The name of the model to query.

Popular models:

- meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo
- Qwen/Qwen2.5-7B-Instruct-Turbo
- Qwen/Qwen2.5-72B-Instruct-Turbo

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models)
"""
model: Required[
Union[
Literal[
"Qwen/Qwen2.5-72B-Instruct-Turbo",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
],
str,
]
]
"""The name of the model to query."""

echo: bool
"""If true, the response will contain the prompt.
Expand Down
Loading