style: some cleanup (#33857)

This commit is contained in:
Mason Daugherty
2025-11-06 23:50:46 -05:00
committed by GitHub
parent d40e340479
commit e023201d42
79 changed files with 662 additions and 531 deletions

View File

@@ -600,10 +600,10 @@ class ChatXAI(BaseChatOpenAI): # type: ignore[override]
Args:
schema: The output schema. Can be passed in as:
- an OpenAI function/tool schema,
- a JSON Schema,
- a `TypedDict` class,
- or a Pydantic class.
- An OpenAI function/tool schema,
- A JSON Schema,
- A `TypedDict` class,
- Or a Pydantic class.
If `schema` is a Pydantic class then the model output will be a
Pydantic instance of that class, and the model-generated fields will be
@@ -624,15 +624,18 @@ class ChatXAI(BaseChatOpenAI): # type: ignore[override]
Uses xAI's JSON mode feature.
include_raw:
If `False` then only the parsed structured output is returned. If
an error occurs during model output parsing it will be raised. If `True`
then both the raw model response (a `BaseMessage`) and the parsed model
response will be returned. If an error occurs during output parsing it
will be caught and returned as well.
If `False` then only the parsed structured output is returned.
If an error occurs during model output parsing it will be raised.
If `True` then both the raw model response (a `BaseMessage`) and the
parsed model response will be returned.
If an error occurs during output parsing it will be caught and returned
as well.
The final output is always a `dict` with keys `'raw'`, `'parsed'`, and
`'parsing_error'`.
strict:
- `True`:
Model output is guaranteed to exactly match the schema.

View File

@@ -3,8 +3,13 @@ requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
authors = []
name = "langchain-xai"
description = "An integration package connecting xAI and LangChain"
license = { text = "MIT" }
readme = "README.md"
authors = []
version = "1.0.0"
requires-python = ">=3.10.0,<4.0.0"
dependencies = [
"langchain-openai>=1.0.0,<2.0.0",
@@ -12,10 +17,6 @@ dependencies = [
"requests>=2.0.0,<3.0.0",
"aiohttp>=3.9.1,<4.0.0",
]
name = "langchain-xai"
version = "1.0.0"
description = "An integration package connecting xAI and LangChain"
readme = "README.md"
[project.urls]
Homepage = "https://docs.langchain.com/oss/python/integrations/providers/xai"