mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-01 12:40:23 +08:00
This commit is contained in:
@@ -102,7 +102,7 @@ with OpenRouter(
|
||||
"role": "user",
|
||||
"content": "Hello, how are you?",
|
||||
},
|
||||
], stream=False, temperature=1, top_p=1)
|
||||
], stream=True, temperature=1, top_p=1)
|
||||
|
||||
with res as event_stream:
|
||||
for event in event_stream:
|
||||
@@ -116,7 +116,6 @@ with OpenRouter(
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `messages` | List[[models.ChatCompletionMessageParam](../../models/chatcompletionmessageparam.md)] | :heavy_check_mark: | List of messages for the conversation | [<br/>{<br/>"role": "user",<br/>"content": "Hello, how are you?"<br/>}<br/>] |
|
||||
| `stream` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable streaming response | |
|
||||
| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | |
|
||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | |
|
||||
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | |
|
||||
@@ -130,6 +129,7 @@ with OpenRouter(
|
||||
| `response_format` | [Optional[models.ChatStreamCompletionCreateParamsResponseFormatUnion]](../../models/chatstreamcompletioncreateparamsresponseformatunion.md) | :heavy_minus_sign: | Response format configuration | |
|
||||
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | |
|
||||
| `stop` | [OptionalNullable[models.ChatStreamCompletionCreateParamsStop]](../../models/chatstreamcompletioncreateparamsstop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | |
|
||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | Enable streaming response | |
|
||||
| `stream_options` | [OptionalNullable[models.ChatStreamCompletionCreateParamsStreamOptions]](../../models/chatstreamcompletioncreateparamsstreamoptions.md) | :heavy_minus_sign: | N/A | |
|
||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | |
|
||||
| `tool_choice` | [Optional[models.ChatCompletionToolChoiceOption]](../../models/chatcompletiontoolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | |
|
||||
|
||||
Reference in New Issue
Block a user