Skip to content

{'error': 'Live search is deprecated. Please switch to the Agent Tools API: https://docs.x.ai/docs/guides/tools/overview'} #34906

@lovesickness111

Description

@lovesickness111

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-perplexity
  • langchain-prompty
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Reproduction Steps / Example Code (Python)

from langchain_xai import ChatXAI

model = ChatXAI(
    model="grok-4",
    search_parameters={
        "mode": "auto",
        # Example optional parameters below:
        "max_search_results": 3,
        "from_date": "2025-05-26",
        "to_date": "2025-05-27",
    },
)

model.invoke("Provide me a digest of world news in the last 24 hours.")

Error Message and Stack Trace (if applicable)

{'error': 'Live search is deprecated. Please switch to the Agent Tools API: https://docs.x.ai/docs/guides/tools/overview'}

Description

i try to call:
from langchain_xai import ChatXAI

model = ChatXAI(
model="grok-4",
search_parameters={
"mode": "auto",
# Example optional parameters below:
"max_search_results": 3,
"from_date": "2025-05-26",
"to_date": "2025-05-27",
},
)

model.invoke("Provide me a digest of world news in the last 24 hours.")

===> {'error': 'Live search is deprecated. Please switch to the Agent Tools API: https://docs.x.ai/docs/guides/tools/overview'}

System Info

langchain-xai 1.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing featureexternalxai`langchain-xai` package issues & PRs

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions