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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**/__pycache__/
**/.speakeasy/temp/
**/.speakeasy/logs/
.vscode/
.speakeasy/reports
README-PYPI.md
Expand Down
442 changes: 215 additions & 227 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,31 @@ generation:
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
sdkInitStyle: constructor
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
nameResolutionFeb2025: false
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
securityFeb2025: false
sharedErrorComponentsApr2025: false
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 1.8.2
version: 1.9.0
additionalDependencies:
dev:
pytest: ^8.2.2
pytest-asyncio: ^0.23.7
authors:
- Mistral
baseErrorName: MistralError
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
description: Python Client SDK for the Mistral AI API.
Expand All @@ -44,8 +51,10 @@ python:
inputModelSuffix: input
maxMethodParams: 15
methodArguments: infer-optional-args
moduleName: ""
outputModelSuffix: output
packageName: mistralai
pytestFilterWarnings: []
pytestTimeout: 0
responseFormat: flat
templateVersion: v2
13 changes: 6 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.517.3
speakeasyVersion: 1.568.2
sources:
mistral-azure-source:
sourceNamespace: mistral-openapi-azure
Expand All @@ -18,7 +18,6 @@ sources:
sourceBlobDigest: sha256:74aeb6a2e0d466c206f983ce79581cc72d205cc7866826282c181207ebe841a2
tags:
- latest
- speakeasy-sdk-regen-1749573609
targets:
mistralai-azure-sdk:
source: mistral-azure-source
Expand All @@ -40,20 +39,20 @@ targets:
sourceRevisionDigest: sha256:21244d618cafcc163c3aa4acbc443ca16c63b8614632b65b87fbb2c4066987f3
sourceBlobDigest: sha256:74aeb6a2e0d466c206f983ce79581cc72d205cc7866826282c181207ebe841a2
codeSamplesNamespace: mistral-openapi-code-samples
codeSamplesRevisionDigest: sha256:dc4396ba994048a9f31c008dced1a46a9e54d89973e9608039a7bc37b1052957
codeSamplesRevisionDigest: sha256:b631243aae349ddebec1b984874a8e1d5b40e67d6229a199a3d5e63ba69d1538
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.517.3
speakeasyVersion: 1.568.2
sources:
mistral-azure-source:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:sha256:c5931a7e0cc2db844149d71db57dfc2178665f0400bc26c90ee113795ea2872f
mistral-google-cloud-source:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8
mistral-openapi:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:sha256:21244d618cafcc163c3aa4acbc443ca16c63b8614632b65b87fbb2c4066987f3
targets:
mistralai-azure-sdk:
target: python
Expand Down
8 changes: 4 additions & 4 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
workflowVersion: 1.0.0
speakeasyVersion: 1.517.3
speakeasyVersion: 1.568.2
sources:
mistral-azure-source:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
mistral-google-cloud-source:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
mistral-openapi:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
targets:
mistralai-azure-sdk:
target: python
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ with Mistral(
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
])
], stream=False)

# Handle response
print(res)
Expand All @@ -168,7 +168,7 @@ async def main():
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
])
], stream=False)

# Handle response
print(res)
Expand Down Expand Up @@ -244,7 +244,7 @@ with Mistral(
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], agent_id="<id>")
], agent_id="<id>", stream=False)

# Handle response
print(res)
Expand All @@ -270,7 +270,7 @@ async def main():
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], agent_id="<id>")
], agent_id="<id>", stream=False)

# Handle response
print(res)
Expand Down Expand Up @@ -547,7 +547,14 @@ with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

res = mistral.beta.conversations.start_stream(inputs="<value>")
res = mistral.beta.conversations.start_stream(inputs=[
{
"object": "entry",
"type": "function.result",
"tool_call_id": "<id>",
"result": "<value>",
},
], stream=True)

with res as event_stream:
for event in event_stream:
Expand Down
8 changes: 4 additions & 4 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ with Mistral(
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
])
], stream=False)

# Handle response
print(res)
Expand All @@ -44,7 +44,7 @@ async def main():
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
])
], stream=False)

# Handle response
print(res)
Expand Down Expand Up @@ -120,7 +120,7 @@ with Mistral(
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], agent_id="<id>")
], agent_id="<id>", stream=False)

# Handle response
print(res)
Expand All @@ -146,7 +146,7 @@ async def main():
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], agent_id="<id>")
], agent_id="<id>", stream=False)

# Handle response
print(res)
Expand Down
14 changes: 7 additions & 7 deletions docs/models/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

| Field | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `model` | *str* | :heavy_check_mark: | N/A |
| `name` | *str* | :heavy_check_mark: | N/A |
| `id` | *str* | :heavy_check_mark: | N/A |
| `version` | *int* | :heavy_check_mark: | N/A |
| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. |
| `tools` | List[[models.AgentTools](../models/agenttools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. |
| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API |
| `model` | *str* | :heavy_check_mark: | N/A |
| `name` | *str* | :heavy_check_mark: | N/A |
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A |
| `object` | [Optional[models.AgentObject]](../models/agentobject.md) | :heavy_minus_sign: | N/A |
| `object` | [Optional[models.AgentObject]](../models/agentobject.md) | :heavy_minus_sign: | N/A |
| `id` | *str* | :heavy_check_mark: | N/A |
| `version` | *int* | :heavy_check_mark: | N/A |
| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
8 changes: 4 additions & 4 deletions docs/models/agentconversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

| Field | Type | Required | Description |
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. |
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. |
| `object` | [Optional[models.AgentConversationObject]](../models/agentconversationobject.md) | :heavy_minus_sign: | N/A |
| `id` | *str* | :heavy_check_mark: | N/A |
| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `agent_id` | *str* | :heavy_check_mark: | N/A |
| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. |
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. |
| `object` | [Optional[models.AgentConversationObject]](../models/agentconversationobject.md) | :heavy_minus_sign: | N/A |
| `agent_id` | *str* | :heavy_check_mark: | N/A |
Loading