Skip to content

Commit 2dcacce

Browse files
Sync Core Integrations API reference (togetherai) on Docusaurus (#10106)
Co-authored-by: Amnah199 <13835656+Amnah199@users.noreply.github.com>
1 parent c8379c3 commit 2dcacce

4 files changed

Lines changed: 48 additions & 20 deletions

File tree

docs-website/reference/integrations-api/togetherai.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(api_key: Secret = Secret.from_env_var("TOGETHER_API_KEY"),
3737
api_base_url: Optional[str] = "https://api.together.xyz/v1",
3838
streaming_callback: Optional[StreamingCallbackT] = None,
3939
system_prompt: Optional[str] = None,
40-
generation_kwargs: Optional[Dict[str, Any]] = None,
40+
generation_kwargs: Optional[dict[str, Any]] = None,
4141
timeout: Optional[float] = None,
4242
max_retries: Optional[int] = None)
4343
```
@@ -82,7 +82,7 @@ inferred from the `OPENAI_MAX_RETRIES` environment variable or set to 5.
8282
#### TogetherAIGenerator.to\_dict
8383

8484
```python
85-
def to_dict() -> Dict[str, Any]
85+
def to_dict() -> dict[str, Any]
8686
```
8787

8888
Serialize this component to a dictionary.
@@ -230,11 +230,11 @@ def __init__(*,
230230
model: str = "meta-llama/Llama-3.3-70B-Instruct-Turbo",
231231
streaming_callback: Optional[StreamingCallbackT] = None,
232232
api_base_url: Optional[str] = "https://api.together.xyz/v1",
233-
generation_kwargs: Optional[Dict[str, Any]] = None,
233+
generation_kwargs: Optional[dict[str, Any]] = None,
234234
tools: Optional[ToolsType] = None,
235235
timeout: Optional[float] = None,
236236
max_retries: Optional[int] = None,
237-
http_client_kwargs: Optional[Dict[str, Any]] = None)
237+
http_client_kwargs: Optional[dict[str, Any]] = None)
238238
```
239239

240240
Creates an instance of TogetherAIChatGenerator. Unless specified otherwise,
@@ -263,6 +263,13 @@ Some of the supported parameters:
263263
events as they become available, with the stream terminated by a data: [DONE] message.
264264
- `safe_prompt`: Whether to inject a safety prompt before all conversations.
265265
- `random_seed`: The seed to use for random sampling.
266+
- `response_format`: A JSON schema or a Pydantic model that enforces the structure of the model's response.
267+
If provided, the output will always be validated against this
268+
format (unless the model returns a tool call).
269+
For details, see the [OpenAI Structured Outputs documentation](https://platform.openai.com/docs/guides/structured-outputs).
270+
Notes:
271+
- For structured outputs with streaming,
272+
the `response_format` must be a JSON schema and not a Pydantic model.
266273
- `tools`: A list of Tool and/or Toolset objects, or a single Toolset for which the model can prepare calls.
267274
Each tool should have a unique name.
268275
- `timeout`: The timeout for the Together AI API call.
@@ -276,7 +283,7 @@ For more information, see the [HTTPX documentation](https://www.python-httpx.org
276283
#### TogetherAIChatGenerator.to\_dict
277284

278285
```python
279-
def to_dict() -> Dict[str, Any]
286+
def to_dict() -> dict[str, Any]
280287
```
281288

282289
Serialize this component to a dictionary.

docs-website/reference_versioned_docs/version-2.18/integrations-api/togetherai.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(api_key: Secret = Secret.from_env_var("TOGETHER_API_KEY"),
3737
api_base_url: Optional[str] = "https://api.together.xyz/v1",
3838
streaming_callback: Optional[StreamingCallbackT] = None,
3939
system_prompt: Optional[str] = None,
40-
generation_kwargs: Optional[Dict[str, Any]] = None,
40+
generation_kwargs: Optional[dict[str, Any]] = None,
4141
timeout: Optional[float] = None,
4242
max_retries: Optional[int] = None)
4343
```
@@ -82,7 +82,7 @@ inferred from the `OPENAI_MAX_RETRIES` environment variable or set to 5.
8282
#### TogetherAIGenerator.to\_dict
8383

8484
```python
85-
def to_dict() -> Dict[str, Any]
85+
def to_dict() -> dict[str, Any]
8686
```
8787

8888
Serialize this component to a dictionary.
@@ -230,11 +230,11 @@ def __init__(*,
230230
model: str = "meta-llama/Llama-3.3-70B-Instruct-Turbo",
231231
streaming_callback: Optional[StreamingCallbackT] = None,
232232
api_base_url: Optional[str] = "https://api.together.xyz/v1",
233-
generation_kwargs: Optional[Dict[str, Any]] = None,
233+
generation_kwargs: Optional[dict[str, Any]] = None,
234234
tools: Optional[ToolsType] = None,
235235
timeout: Optional[float] = None,
236236
max_retries: Optional[int] = None,
237-
http_client_kwargs: Optional[Dict[str, Any]] = None)
237+
http_client_kwargs: Optional[dict[str, Any]] = None)
238238
```
239239

240240
Creates an instance of TogetherAIChatGenerator. Unless specified otherwise,
@@ -263,6 +263,13 @@ Some of the supported parameters:
263263
events as they become available, with the stream terminated by a data: [DONE] message.
264264
- `safe_prompt`: Whether to inject a safety prompt before all conversations.
265265
- `random_seed`: The seed to use for random sampling.
266+
- `response_format`: A JSON schema or a Pydantic model that enforces the structure of the model's response.
267+
If provided, the output will always be validated against this
268+
format (unless the model returns a tool call).
269+
For details, see the [OpenAI Structured Outputs documentation](https://platform.openai.com/docs/guides/structured-outputs).
270+
Notes:
271+
- For structured outputs with streaming,
272+
the `response_format` must be a JSON schema and not a Pydantic model.
266273
- `tools`: A list of Tool and/or Toolset objects, or a single Toolset for which the model can prepare calls.
267274
Each tool should have a unique name.
268275
- `timeout`: The timeout for the Together AI API call.
@@ -276,7 +283,7 @@ For more information, see the [HTTPX documentation](https://www.python-httpx.org
276283
#### TogetherAIChatGenerator.to\_dict
277284

278285
```python
279-
def to_dict() -> Dict[str, Any]
286+
def to_dict() -> dict[str, Any]
280287
```
281288

282289
Serialize this component to a dictionary.

docs-website/reference_versioned_docs/version-2.19/integrations-api/togetherai.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(api_key: Secret = Secret.from_env_var("TOGETHER_API_KEY"),
3737
api_base_url: Optional[str] = "https://api.together.xyz/v1",
3838
streaming_callback: Optional[StreamingCallbackT] = None,
3939
system_prompt: Optional[str] = None,
40-
generation_kwargs: Optional[Dict[str, Any]] = None,
40+
generation_kwargs: Optional[dict[str, Any]] = None,
4141
timeout: Optional[float] = None,
4242
max_retries: Optional[int] = None)
4343
```
@@ -82,7 +82,7 @@ inferred from the `OPENAI_MAX_RETRIES` environment variable or set to 5.
8282
#### TogetherAIGenerator.to\_dict
8383

8484
```python
85-
def to_dict() -> Dict[str, Any]
85+
def to_dict() -> dict[str, Any]
8686
```
8787

8888
Serialize this component to a dictionary.
@@ -230,11 +230,11 @@ def __init__(*,
230230
model: str = "meta-llama/Llama-3.3-70B-Instruct-Turbo",
231231
streaming_callback: Optional[StreamingCallbackT] = None,
232232
api_base_url: Optional[str] = "https://api.together.xyz/v1",
233-
generation_kwargs: Optional[Dict[str, Any]] = None,
233+
generation_kwargs: Optional[dict[str, Any]] = None,
234234
tools: Optional[ToolsType] = None,
235235
timeout: Optional[float] = None,
236236
max_retries: Optional[int] = None,
237-
http_client_kwargs: Optional[Dict[str, Any]] = None)
237+
http_client_kwargs: Optional[dict[str, Any]] = None)
238238
```
239239

240240
Creates an instance of TogetherAIChatGenerator. Unless specified otherwise,
@@ -263,6 +263,13 @@ Some of the supported parameters:
263263
events as they become available, with the stream terminated by a data: [DONE] message.
264264
- `safe_prompt`: Whether to inject a safety prompt before all conversations.
265265
- `random_seed`: The seed to use for random sampling.
266+
- `response_format`: A JSON schema or a Pydantic model that enforces the structure of the model's response.
267+
If provided, the output will always be validated against this
268+
format (unless the model returns a tool call).
269+
For details, see the [OpenAI Structured Outputs documentation](https://platform.openai.com/docs/guides/structured-outputs).
270+
Notes:
271+
- For structured outputs with streaming,
272+
the `response_format` must be a JSON schema and not a Pydantic model.
266273
- `tools`: A list of Tool and/or Toolset objects, or a single Toolset for which the model can prepare calls.
267274
Each tool should have a unique name.
268275
- `timeout`: The timeout for the Together AI API call.
@@ -276,7 +283,7 @@ For more information, see the [HTTPX documentation](https://www.python-httpx.org
276283
#### TogetherAIChatGenerator.to\_dict
277284

278285
```python
279-
def to_dict() -> Dict[str, Any]
286+
def to_dict() -> dict[str, Any]
280287
```
281288

282289
Serialize this component to a dictionary.

docs-website/reference_versioned_docs/version-2.20/integrations-api/togetherai.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(api_key: Secret = Secret.from_env_var("TOGETHER_API_KEY"),
3737
api_base_url: Optional[str] = "https://api.together.xyz/v1",
3838
streaming_callback: Optional[StreamingCallbackT] = None,
3939
system_prompt: Optional[str] = None,
40-
generation_kwargs: Optional[Dict[str, Any]] = None,
40+
generation_kwargs: Optional[dict[str, Any]] = None,
4141
timeout: Optional[float] = None,
4242
max_retries: Optional[int] = None)
4343
```
@@ -82,7 +82,7 @@ inferred from the `OPENAI_MAX_RETRIES` environment variable or set to 5.
8282
#### TogetherAIGenerator.to\_dict
8383

8484
```python
85-
def to_dict() -> Dict[str, Any]
85+
def to_dict() -> dict[str, Any]
8686
```
8787

8888
Serialize this component to a dictionary.
@@ -230,11 +230,11 @@ def __init__(*,
230230
model: str = "meta-llama/Llama-3.3-70B-Instruct-Turbo",
231231
streaming_callback: Optional[StreamingCallbackT] = None,
232232
api_base_url: Optional[str] = "https://api.together.xyz/v1",
233-
generation_kwargs: Optional[Dict[str, Any]] = None,
233+
generation_kwargs: Optional[dict[str, Any]] = None,
234234
tools: Optional[ToolsType] = None,
235235
timeout: Optional[float] = None,
236236
max_retries: Optional[int] = None,
237-
http_client_kwargs: Optional[Dict[str, Any]] = None)
237+
http_client_kwargs: Optional[dict[str, Any]] = None)
238238
```
239239

240240
Creates an instance of TogetherAIChatGenerator. Unless specified otherwise,
@@ -263,6 +263,13 @@ Some of the supported parameters:
263263
events as they become available, with the stream terminated by a data: [DONE] message.
264264
- `safe_prompt`: Whether to inject a safety prompt before all conversations.
265265
- `random_seed`: The seed to use for random sampling.
266+
- `response_format`: A JSON schema or a Pydantic model that enforces the structure of the model's response.
267+
If provided, the output will always be validated against this
268+
format (unless the model returns a tool call).
269+
For details, see the [OpenAI Structured Outputs documentation](https://platform.openai.com/docs/guides/structured-outputs).
270+
Notes:
271+
- For structured outputs with streaming,
272+
the `response_format` must be a JSON schema and not a Pydantic model.
266273
- `tools`: A list of Tool and/or Toolset objects, or a single Toolset for which the model can prepare calls.
267274
Each tool should have a unique name.
268275
- `timeout`: The timeout for the Together AI API call.
@@ -276,7 +283,7 @@ For more information, see the [HTTPX documentation](https://www.python-httpx.org
276283
#### TogetherAIChatGenerator.to\_dict
277284

278285
```python
279-
def to_dict() -> Dict[str, Any]
286+
def to_dict() -> dict[str, Any]
280287
```
281288

282289
Serialize this component to a dictionary.

0 commit comments

Comments
 (0)