ChatXAI returns malformed usage_metadata
#8220
Labels
auto:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
await ChatXAI({ model: 'grok-3-mini', temperature: 0.3, reasoningEffort: 'high' }).invoke(...)
Error Message and Stack Trace (if applicable)
No response
Description
When using
invoke
withgrok-3-mini
orgrok-3-mini-fast
underChatXAI
, theusage_metadata
is not properly extracted from the model API response; the proper, raw response can be viewed under theresponse_metadata
.The
usage_metadata
should include the proper token counts; and should propagate properly in the resultingLangSmith
dashboards.System Info
[email protected] | MIT | deps: 12 | versions: 321
Typescript bindings for langchain
https://github.com/langchain-ai/langchainjs/tree/main/langchain/
keywords: llm, ai, gpt3, chain, prompt, prompt engineering, chatgpt, machine learning, ml, openai, embeddings, vectorstores
dist
.tarball: https://registry.npmjs.org/langchain/-/langchain-0.3.26.tgz
.shasum: 5e1dec39172d1589bfee369a710b2e2459c3df8e
.integrity: sha512-W/9phB4wiAnj+PnpMWmv/ptIp7i5ygY2aK8yjKlxccHPbaNeMoy7njzFz8d0/xfcPyA3MvG4AuZnJ1j3/E2/Ig==
.unpackedSize: 2.9 MB
dependencies:
@langchain/openai: >=0.1.0 <0.6.0 jsonpointer: ^5.0.1 uuid: ^10.0.0
@langchain/textsplitters: >=0.0.0 <0.2.0 langsmith: ^0.3.29 yaml: ^2.2.1
js-tiktoken: ^1.0.12 openapi-types: ^12.1.3 zod-to-json-schema: ^3.22.3
js-yaml: ^4.1.0 p-retry: 4 zod: ^3.22.4
maintainers:
dist-tags:
latest: 0.3.26 tag-for-publishing-older-releases: 0.2.20
next: 0.3.2-rc.0
published 5 days ago by benjamincburns [email protected]
node Version: v18.20.8
pnpm version: v10.2.0
The text was updated successfully, but these errors were encountered: