页面简介
Create an agent that searches the web for recent information, read its output, and restrict searches with domain filtering.
正文摘录
⌘KStudioOverviewConceptsChoose what to buildDeveloper toolsMistral CLIOverviewQuickstartTelemetryCLI referenceMistral MCPBuildAgentsOverviewGet startedIntroductionFeature highlightsQuickstartDeploy your agentMove from the Agents APIFeedbackLearnLearnAgentsWhat an agent isConfiguring the agentToolsApprovalsConnectors and MCPSkillsStructured outputSecretsGuardrailsEnvironmentEnvironmentMistral sandboxLocal sandboxesSandbox setupSandbox hooksNetworkSessionsSessionsTurns and the turn recordEventsHistory entriesRunsRunsOne call: agent.run()Step through a sessionBuild a session appCallbacksDeploymentRun modesLocal, in-processSelf-hosted: mistral agents serveMistral-managed: mistral agents deployAgent lifecycleSession lifecycle and listingMultiagentSubagentsConfigure subagentsApprovals across subagentsAPI referenceOverviewAgentSession and TurnTurn recordsApprovals and sign-insTools and client toolsEvents and history entriesErrorsListing, Client and local runtimeSandboxesConnectors and MCPHooks and contextsTestingExperimentalCLI referenceExamplesOverviewMini Vibe: a coding agentQA swarm: 60 agents test jqMission: build jq from its manualSuspicious payment reviewMajordome: an assistant that messages firstPR reviewer as a GitHub ActionPrivate repository cleanup agentSlack feedback triage botTelegram weather botUsed car finderCookbooksCookbooksValidate structured outputSeveral clients on one sessionOne approval policy for every subagentPrivate data guardOne shared key for a connectorStop and answer a turn by idSlack bot: one session per threadLoop breakerLive progressIssue triage swarm: one agent per issueDeprecatedOverviewAgents & ConversationsAgent ToolsOverviewWebsearchCode InterpreterImage GenerationFunction CallingHandoffsWorkflowsOverviewBuild your first workflowConceptsOverviewWorkflowsActivitiesExecutionsEventsWorkersDeploymentsBuilding WorkflowsBuilding WorkflowsInstall the SDKBuild in VibeVisualize your workflowWorkflowsOverviewDeterminismActivitiesOverviewBasicsLocal activitiesSticky worker sessionsDependency InjectionConnectors in workflowsMistral clientStreaming EventsConsuming Streaming EventsDurable agentsPayload offloadingWorkflow schedulingChild workflowsPluginsWaiting for ConditionsContinue-As-NewWorkflows ExceptionOn-behalf-of workflowsEncryptionCompressionWorkflow TagsSearch keysTriggers and webhooksInteracting with WorkflowsInteracting with WorkflowsSignalsQueriesUpdatesConversational workflowsOverviewForms and confirmationsProgress trackingCanvasTool UIPublish in VibeManaging Workflows in ProductionManaging Workflows in ProductionConcurrency PatternsRate LimitingAPI Error CodesResetting WorkflowsExecution ContextObservabilityMigrate from SDK v3 to v4AppsOverviewQuickstartLocal developmentDeployPublish to VibeCapabilitiesAvailable capabilitiesSelecting capabilitiesSecrets ManagerContextConnectorsOverviewQuickstartManage connectorsHTTP connectorsDebug connectorsProvidersProvidersGoogleMicrosoftUse connectors in conversationsDirect tool calling with connectorsHuman-in-the-loopLibrariesOverviewQuickstartPrompts & SkillsOverviewQuickstartCreate a prompt in StudioCreate a skill in StudioVersions and aliasesUse prompts in chat completionsSearchAgentic SearchKnowledgeSearch IndexOverviewCreate and query an indexBasic operationsSearch ToolkitOverviewQuickstartConceptsConceptsDocument modelEmbedding modelSearch IndexOverviewMistral Search IndexVespaOverviewAnatomy of an applicationManage schemaManage rankingLocal developmentDeploy and operateCLI referenceMigration helpersPostgresQdrantCustom vector storesIngestionOverviewFile loadersDocument extractorsText splittersChunk enrichersEmbeddersRetrievalOverviewRetrieversFiltersDocument navigationChangelogDeployOverviewManaged deploymentsIntroductionAppsWorkflowsOverviewQuickstartHow it worksSecretsQuotasTroubleshootingSelf-hosted deploymentsIntroductionWorkflowsHardened workflow deploymentsTriggers and webhooksObserve & evaluateOverviewDistributed tracingOverviewQuickstartSend tracesExplore tracesData redactionOffline evaluationsOverviewQuickstartDatasetsSystem paramsEvaluatorsGoalsStatisticsAgentsOptimizationAdvanced guidesAdvanced guidesUse context objectsMultiple evaluatorsUse run-level evaluatorsIterate locallyReduce variance with multiple generationsRetry failed recordsRescore persisted runsDisplay formatWorkflows pluginOverviewTask modesDecoratorsOptimizationAgentsRescoringBuilding blocksAPI referenceAPI referenceLimitsOnline evaluationsOverviewQuickstartScorersLive evalsReading resultsAPI referenceGovernGovernanceContent markingModeration & GuardrailingOverviewModerate an inputVoiceOverviewConceptsConceptsOffline and realtimeLatencyTurns and turn-takingCustom vocabularySpeakers and diarizationVoicesSpeech to TextOverviewQuickstartsOverviewTranscribe an audio fileTranscribe in realtimeFile transcriptionRealtime transcriptionTurn detectionDiarize speakersContext biasTroubleshootingText to SpeechOverviewGenerate speechSpeech generationStyle instructionsEmotion and pace tagsCustom pronunciationStream speechSpeak in realtimeVoicesVoice cloningTroubleshootingAudio in chatVoice agentsOverviewBuild a voice agentAgentsAgent configurationToolsManage agent sessionsBrowser guideTelephonyCustom audioWebhooksAudio interfaceSpecs and limitsSpecs and limitsLanguagesAudio formatsLimitsMigrate from Voxtral 2DeprecatedOverviewSpeech to TextOverviewOfflineRealtime transcriptionOverviewClient authenticationText to SpeechOverviewVoicesSpeech GenerationOCRDocument ProcessingOCR ProcessorDocument AnnotationsDocument QnAStudioManaged AgentsToolsWebsearchCopy pageWebsearchCreate an agent that searches the web for recent information, read its output, and restrict searches with domain filtering.Websearch is the capability to browse the web in search of information, this tool does not only fix the limitations of models of not being up to date due to their training data, but also allows them to actually retrieve recent information or access specific websites. A handy tool for any agent that needs to be up to date with the world. Our built-in tool for websearch allows any of our models to access the web at any point to search websites and sources for relevant information to answer the given query. There are two versions: web_search: A simple web search tool that enables access to a search engine.web_search_premium: A more complex web search tool that enables access to both a search engine and to news articles via integrated news provider verification. web_search and web_search_premium work with the Conversations API (/v1/conversations) and the Agents API. They aren't supported in the Chat Completions API (/v1/chat/completions) because Chat Completions responses don't include the search result references that these tools return. Create a Websearch AgentCopy section link You can create an agent with access to websearch by providing it as one of the tools.<br /> Note that you can still add more tools to the agent, the model is free to search the web or not on demand. pythontypescriptcurlwebsearch_agent = client.beta.agents.create( model="mistral-medium-latest", description="Agent able to search information over the web, such as news, weather, sport results...", name="Websearch Agent", instructions="You have the ability to perform web searches with `web_search` to find up-to-date information.", tools=[{"type": "web_search"}], completion_args={ "temperature": 0.3, "top_p": 0.95, } ) const websearchAgent = await client.beta.agents.create({ model: "mistral-medium-latest", name: "WebSearch Agent", instructions: "Use your websearch abilities when answering requests you don't know.", description: "Agent able to fetch new information on the web.", tools: [{ type: "web_search" }], }); curl --location "https://api.mistral.ai/v1/agents" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header "Authorization: Bearer $MISTRAL_API_KEY" \ --data '{ "model": "mistral-medium-latest", "name": "Websearch Agent", "description": "Agent able to search information over the web, such as news, weather, sport results...", "instructions": "You have the ability to perform web searches with `web_search` to find up-to-date information.", "tools": [ { "type": "web_search" } ], "completion_args": { "temperature": 0.3, "top_p": 0.95 } }' OutputOutput{ "model": "mistral-medium-latest", "name": "Websearch Agent", "description": "Agent able to search information over the web, such as news, weather, sport results...", "id": "ag_06835b734cc47dec8000b5f8f860b672", "version": 0, "created_at": "2025-05-27T12:59:32.803403Z", "updated_at": "2025-05-27T12:59:32.803405Z", "instructions": "You have the ability to perform web searches with `web_search` to find up-to-date information.", "tools": [ { "type": "web_search" } ], "completion_args": { "stop": null, "presence_penalty": null, "frequency_penalty": null, "temperature": 0.3, "top_p": 0.95, "max_tokens": null, "random_seed": null, "prediction": null, "response_format": null, "tool_choice": "auto" }, "handoffs": null, "object": "agent" } As for other agents, when creating one you will receive an agent id corresponding to the created agent that you can use to start a conversation. How it WorksCopy section link Now that we have our websearch agent ready, we can at any point make use of it to ask it questions about recent events. Conversations with WebsearchCopy section link To start a conversation with our websearch agent, we can use the following code: pythontypescriptcurlresponse = client.beta.conversations.start( agent_id=websearch_agent.id, inputs="Who won the last European Football cup?" ) let conversation = await client.beta.conversations.start({ agentId: agent.id, inputs:"Who is Albert Einstein?", //store:false }); curl --location "https://api.mistral.ai/v1/conversations" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header "Authorization: Bearer $MISTRAL_API_KEY" \ --data '{ "inputs": "Who won the last