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: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2FTogetherAI-6e975518a2563fdb57394133f1ed9dfe426a2cf5d2fef793fd139627c93df4aa.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2FTogetherAI-5934359dd4fbab352cb5042ffbf08374bd3d3b6bc0550fd09797de44626772fe.yml
4 changes: 2 additions & 2 deletions src/together/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def qs(self) -> Querystring:
@override
def auth_headers(self) -> dict[str, str]:
api_key = self.api_key
return {"Authorization": f"Bearer {api_key}"}
return {"Authorization": api_key}

@property
@override
Expand Down Expand Up @@ -313,7 +313,7 @@ def qs(self) -> Querystring:
@override
def auth_headers(self) -> dict[str, str]:
api_key = self.api_key
return {"Authorization": f"Bearer {api_key}"}
return {"Authorization": api_key}

@property
@override
Expand Down
46 changes: 26 additions & 20 deletions src/together/resources/chat/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def create(
model: str,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -74,7 +74,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ChatCompletion:
"""
Creates a model response for the given chat conversation.
Query a chat model.

Args:
messages: A list of messages comprising the conversation so far.
Expand Down Expand Up @@ -114,7 +114,8 @@ def create(
stop: A list of string sequences that will truncate (stop) inference text output.

stream: If set, tokens are returned as Server-Sent Events as they are made available.
Stream terminates with `data: [DONE]`
Stream terminates with `data: [DONE]`. If false, return a single JSON object
containing the results.

temperature: Determines the degree of randomness in the response.

Expand Down Expand Up @@ -147,7 +148,7 @@ def create(
stream: Literal[True],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -170,15 +171,16 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Stream[ChatCompletionChunk]:
"""
Creates a model response for the given chat conversation.
Query a chat model.

Args:
messages: A list of messages comprising the conversation so far.

model: The name of the model to query.

stream: If set, tokens are returned as Server-Sent Events as they are made available.
Stream terminates with `data: [DONE]`
Stream terminates with `data: [DONE]`. If false, return a single JSON object
containing the results.

echo: If set, the response will contain the prompt, and will also return prompt
logprobs if set with logprobs.
Expand Down Expand Up @@ -243,7 +245,7 @@ def create(
stream: bool,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -266,15 +268,16 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ChatCompletion | Stream[ChatCompletionChunk]:
"""
Creates a model response for the given chat conversation.
Query a chat model.

Args:
messages: A list of messages comprising the conversation so far.

model: The name of the model to query.

stream: If set, tokens are returned as Server-Sent Events as they are made available.
Stream terminates with `data: [DONE]`
Stream terminates with `data: [DONE]`. If false, return a single JSON object
containing the results.

echo: If set, the response will contain the prompt, and will also return prompt
logprobs if set with logprobs.
Expand Down Expand Up @@ -338,7 +341,7 @@ def create(
model: str,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -414,7 +417,7 @@ async def create(
model: str,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -438,7 +441,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ChatCompletion:
"""
Creates a model response for the given chat conversation.
Query a chat model.

Args:
messages: A list of messages comprising the conversation so far.
Expand Down Expand Up @@ -478,7 +481,8 @@ async def create(
stop: A list of string sequences that will truncate (stop) inference text output.

stream: If set, tokens are returned as Server-Sent Events as they are made available.
Stream terminates with `data: [DONE]`
Stream terminates with `data: [DONE]`. If false, return a single JSON object
containing the results.

temperature: Determines the degree of randomness in the response.

Expand Down Expand Up @@ -511,7 +515,7 @@ async def create(
stream: Literal[True],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -534,15 +538,16 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncStream[ChatCompletionChunk]:
"""
Creates a model response for the given chat conversation.
Query a chat model.

Args:
messages: A list of messages comprising the conversation so far.

model: The name of the model to query.

stream: If set, tokens are returned as Server-Sent Events as they are made available.
Stream terminates with `data: [DONE]`
Stream terminates with `data: [DONE]`. If false, return a single JSON object
containing the results.

echo: If set, the response will contain the prompt, and will also return prompt
logprobs if set with logprobs.
Expand Down Expand Up @@ -607,7 +612,7 @@ async def create(
stream: bool,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -630,15 +635,16 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ChatCompletion | AsyncStream[ChatCompletionChunk]:
"""
Creates a model response for the given chat conversation.
Query a chat model.

Args:
messages: A list of messages comprising the conversation so far.

model: The name of the model to query.

stream: If set, tokens are returned as Server-Sent Events as they are made available.
Stream terminates with `data: [DONE]`
Stream terminates with `data: [DONE]`. If false, return a single JSON object
containing the results.

echo: If set, the response will contain the prompt, and will also return prompt
logprobs if set with logprobs.
Expand Down Expand Up @@ -702,7 +708,7 @@ async def create(
model: str,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand Down
28 changes: 14 additions & 14 deletions src/together/resources/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create(
prompt: str,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -69,7 +69,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Completion:
"""
Creates a completion for the provided prompt and parameters
Query a language, code, or image model.

Args:
model: The name of the model to query.
Expand Down Expand Up @@ -136,7 +136,7 @@ def create(
stream: Literal[True],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -156,7 +156,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Stream[Completion]:
"""
Creates a completion for the provided prompt and parameters
Query a language, code, or image model.

Args:
model: The name of the model to query.
Expand Down Expand Up @@ -223,7 +223,7 @@ def create(
stream: bool,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -243,7 +243,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Completion | Stream[Completion]:
"""
Creates a completion for the provided prompt and parameters
Query a language, code, or image model.

Args:
model: The name of the model to query.
Expand Down Expand Up @@ -309,7 +309,7 @@ def create(
prompt: str,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -379,7 +379,7 @@ async def create(
prompt: str,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -400,7 +400,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Completion:
"""
Creates a completion for the provided prompt and parameters
Query a language, code, or image model.

Args:
model: The name of the model to query.
Expand Down Expand Up @@ -467,7 +467,7 @@ async def create(
stream: Literal[True],
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -487,7 +487,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncStream[Completion]:
"""
Creates a completion for the provided prompt and parameters
Query a language, code, or image model.

Args:
model: The name of the model to query.
Expand Down Expand Up @@ -554,7 +554,7 @@ async def create(
stream: bool,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand All @@ -574,7 +574,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Completion | AsyncStream[Completion]:
"""
Creates a completion for the provided prompt and parameters
Query a language, code, or image model.

Args:
model: The name of the model to query.
Expand Down Expand Up @@ -640,7 +640,7 @@ async def create(
prompt: str,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, object] | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: int | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
min_p: float | NotGiven = NOT_GIVEN,
Expand Down
4 changes: 2 additions & 2 deletions src/together/resources/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Embedding:
"""
Creates an embedding vector representing the input text
Query an embedding model for a given string of text.

Args:
input: A string providing the text for the model to embed.
Expand Down Expand Up @@ -101,7 +101,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Embedding:
"""
Creates an embedding vector representing the input text
Query an embedding model for a given string of text.

Args:
input: A string providing the text for the model to embed.
Expand Down
Loading