@langchain/xai 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat_models.cjs +3 -3
- package/dist/chat_models.d.ts +7 -7
- package/dist/chat_models.js +3 -3
- package/package.json +5 -6
package/dist/chat_models.cjs
CHANGED
|
@@ -21,11 +21,11 @@ const openai_1 = require("@langchain/openai");
|
|
|
21
21
|
* ## [Runtime args](https://api.js.langchain.com/interfaces/_langchain_xai.ChatXAICallOptions.html)
|
|
22
22
|
*
|
|
23
23
|
* Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
|
|
24
|
-
* They can also be passed via `.
|
|
24
|
+
* They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:
|
|
25
25
|
*
|
|
26
26
|
* ```typescript
|
|
27
|
-
* // When calling `.
|
|
28
|
-
* const llmWithArgsBound = llm.
|
|
27
|
+
* // When calling `.withConfig`, call options should be passed via the first argument
|
|
28
|
+
* const llmWithArgsBound = llm.withConfig({
|
|
29
29
|
* stop: ["\n"],
|
|
30
30
|
* tools: [...],
|
|
31
31
|
* });
|
package/dist/chat_models.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { BaseChatModelCallOptions, BindToolsInput, LangSmithParams, type BaseCha
|
|
|
3
3
|
import { Serialized } from "@langchain/core/load/serializable";
|
|
4
4
|
import { AIMessageChunk, BaseMessage } from "@langchain/core/messages";
|
|
5
5
|
import { Runnable } from "@langchain/core/runnables";
|
|
6
|
+
import { InteropZodType } from "@langchain/core/utils/types";
|
|
6
7
|
import { type OpenAICoreRequestOptions, type OpenAIClient, ChatOpenAI, OpenAIToolChoice, ChatOpenAIStructuredOutputMethodOptions } from "@langchain/openai";
|
|
7
|
-
import { z } from "zod";
|
|
8
8
|
type ChatXAIToolType = BindToolsInput | OpenAIClient.ChatCompletionTool;
|
|
9
9
|
export interface ChatXAICallOptions extends BaseChatModelCallOptions {
|
|
10
10
|
headers?: Record<string, string>;
|
|
@@ -66,11 +66,11 @@ export interface ChatXAIInput extends BaseChatModelParams {
|
|
|
66
66
|
* ## [Runtime args](https://api.js.langchain.com/interfaces/_langchain_xai.ChatXAICallOptions.html)
|
|
67
67
|
*
|
|
68
68
|
* Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
|
|
69
|
-
* They can also be passed via `.
|
|
69
|
+
* They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:
|
|
70
70
|
*
|
|
71
71
|
* ```typescript
|
|
72
|
-
* // When calling `.
|
|
73
|
-
* const llmWithArgsBound = llm.
|
|
72
|
+
* // When calling `.withConfig`, call options should be passed via the first argument
|
|
73
|
+
* const llmWithArgsBound = llm.withConfig({
|
|
74
74
|
* stop: ["\n"],
|
|
75
75
|
* tools: [...],
|
|
76
76
|
* });
|
|
@@ -389,12 +389,12 @@ export declare class ChatXAI extends ChatOpenAI<ChatXAICallOptions> {
|
|
|
389
389
|
completionWithRetry(request: OpenAIClient.Chat.ChatCompletionCreateParamsNonStreaming, options?: OpenAICoreRequestOptions): Promise<OpenAIClient.Chat.Completions.ChatCompletion>;
|
|
390
390
|
protected _convertOpenAIDeltaToBaseMessageChunk(delta: Record<string, any>, rawResponse: OpenAIClient.ChatCompletionChunk, defaultRole?: "function" | "user" | "system" | "developer" | "assistant" | "tool"): AIMessageChunk;
|
|
391
391
|
protected _convertOpenAIChatCompletionMessageToBaseMessage(message: OpenAIClient.ChatCompletionMessage, rawResponse: OpenAIClient.ChatCompletion): BaseMessage;
|
|
392
|
-
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema:
|
|
393
|
-
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema:
|
|
392
|
+
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: ChatOpenAIStructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;
|
|
393
|
+
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: ChatOpenAIStructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {
|
|
394
394
|
raw: BaseMessage;
|
|
395
395
|
parsed: RunOutput;
|
|
396
396
|
}>;
|
|
397
|
-
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema:
|
|
397
|
+
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: ChatOpenAIStructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {
|
|
398
398
|
raw: BaseMessage;
|
|
399
399
|
parsed: RunOutput;
|
|
400
400
|
}>;
|
package/dist/chat_models.js
CHANGED
|
@@ -18,11 +18,11 @@ import { ChatOpenAI, } from "@langchain/openai";
|
|
|
18
18
|
* ## [Runtime args](https://api.js.langchain.com/interfaces/_langchain_xai.ChatXAICallOptions.html)
|
|
19
19
|
*
|
|
20
20
|
* Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
|
|
21
|
-
* They can also be passed via `.
|
|
21
|
+
* They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:
|
|
22
22
|
*
|
|
23
23
|
* ```typescript
|
|
24
|
-
* // When calling `.
|
|
25
|
-
* const llmWithArgsBound = llm.
|
|
24
|
+
* // When calling `.withConfig`, call options should be passed via the first argument
|
|
25
|
+
* const llmWithArgsBound = llm.withConfig({
|
|
26
26
|
* stop: ["\n"],
|
|
27
27
|
* tools: [...],
|
|
28
28
|
* });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/xai",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "xAI integration for LangChain.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -35,11 +35,10 @@
|
|
|
35
35
|
"author": "LangChain",
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@langchain/openai": "
|
|
39
|
-
"zod": "^3.24.2"
|
|
38
|
+
"@langchain/openai": "^0.5.5"
|
|
40
39
|
},
|
|
41
40
|
"peerDependencies": {
|
|
42
|
-
"@langchain/core": ">=0.
|
|
41
|
+
"@langchain/core": ">=0.3.58 <0.4.0"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
44
|
"@jest/globals": "^29.5.0",
|
|
@@ -64,11 +63,11 @@
|
|
|
64
63
|
"jest": "^29.5.0",
|
|
65
64
|
"jest-environment-node": "^29.6.4",
|
|
66
65
|
"prettier": "^2.8.3",
|
|
67
|
-
"release-it": "^
|
|
66
|
+
"release-it": "^18.1.2",
|
|
68
67
|
"rollup": "^4.5.2",
|
|
69
68
|
"ts-jest": "^29.1.0",
|
|
70
69
|
"typescript": "<5.2.0",
|
|
71
|
-
"zod
|
|
70
|
+
"zod": "^3.25.32"
|
|
72
71
|
},
|
|
73
72
|
"publishConfig": {
|
|
74
73
|
"access": "public"
|