Skip to main content

Vibe SDK

Project description

Vibe SDK

High-level agent interface for the Vibe protocol.

Quick Start

from mistralai.vibe.protocol.patterns.completion.adapters.mistral import MistralCompletion
from mistralai.vibe.sdk import Agent, AgentConfig

completion = MistralCompletion.from_env(model="mistral-large-latest")
agent = Agent(
    config=AgentConfig(model="mistral-large-latest"),
    completion=completion,
)

# Async
async with agent.session() as session:
    async for state in session.run("Hello"):
        print(state)

# Sync
with agent.session_sync() as session:
    for state in session.run("Hello"):
        print(state)

Custom Local Tasks

To customize the underlying task implementation, pass an agent_task_factory. The factory receives the compiled AgentTaskConfig and the runtime completion, then returns any Task implementation. completion is still passed to Agent; the factory just receives it explicitly instead of capturing it through a partial.

from mistralai.vibe.protocol import AgentTask
from mistralai.vibe.protocol.patterns.completion.adapters.mistral import MistralCompletion

completion = MistralCompletion.from_env(model="mistral-large-latest")

def build_task(task_config, completion):
    return AgentTask(
        completion=completion,
        tasks={"my_tool": MyTask()},
        model_name=task_config.model,
        name=task_config.name,
        system_prompt=task_config.system_prompt,
        max_iterations=task_config.max_iterations,
    )


agent = Agent(
    config=AgentConfig(model="mistral-large-latest"),
    completion=completion,
    agent_task_factory=build_task,
)

Durable Tasks

Use the durable helper when you want Agent sessions to start workflow-backed tasks instead of local AgentTask instances. Install the workflow extra and import the helper from the workflow namespace.

from mistralai.client import Mistral
from mistralai.vibe.sdk.workflow import create_durable_agent_task_factory

client = Mistral(api_key="...").workflows

agent = Agent(
    config=AgentConfig(model="mistral-large-latest"),
    completion=completion,
    agent_task_factory=create_durable_agent_task_factory(
        client=client,
        task_queue="agents",
    ),
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mistralai_vibe_sdk-0.2.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mistralai_vibe_sdk-0.2.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file mistralai_vibe_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: mistralai_vibe_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mistralai_vibe_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1112840e62cf60d4fac5bc4febe034b02446e6c233242c59c6efdfd5824315e1
MD5 82cb1be60ded747d5c4d106224197c23
BLAKE2b-256 5d46ad6da6e4fcfc980a8a819ddbdd26329c2b1f35bfd8e06718cfb503318998

See more details on using hashes here.

Provenance

The following attestation bundles were made for mistralai_vibe_sdk-0.2.0.tar.gz:

Publisher: release.yml on mistralai/vibe-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mistralai_vibe_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mistralai_vibe_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b47e63437033c08fadad937bb25c157ef179a5f2c1740c1765508622b9f3582c
MD5 9947d4e343e4394ec9bb006573086fd8
BLAKE2b-256 9a258c8bb5fa68b570505f2c01def496ef12acd46424679b467622a53f97a485

See more details on using hashes here.

Provenance

The following attestation bundles were made for mistralai_vibe_sdk-0.2.0-py3-none-any.whl:

Publisher: release.yml on mistralai/vibe-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page