qwen.js 0.1.6 → 0.1.7
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/client.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -13
- package/dist/types.d.ts +1 -12
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export declare class QwenClient {
|
|
|
17
17
|
chat(messages: ChatMessage[], options?: ChatOptions): Promise<ChatResponse>;
|
|
18
18
|
chatStream(messages: ChatMessage[] | string, options?: ChatOptions): AsyncGenerator<string, void, unknown>;
|
|
19
19
|
ask(prompt: string, options?: ChatOptions): Promise<string>;
|
|
20
|
-
createImageMessage(text: string, imageUrls: string[]): ChatMessage;
|
|
21
20
|
setModel(model: string): void;
|
|
22
21
|
getModel(): string;
|
|
23
22
|
createToolResult(toolCallId: string, content: string): ChatMessage;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { QwenClient } from "./client";
|
|
2
2
|
export { generatePKCE, requestDeviceCode, pollForToken, refreshAccessToken, isTokenExpired, } from "./auth";
|
|
3
|
-
export type { QwenConfig, ChatMessage, ChatOptions, ChatResponse, ChatSession, StreamChunk, TokenState, DeviceCodeResponse, TokenResponse, PKCEPair, Tool, ToolCall, ToolResult,
|
|
3
|
+
export type { QwenConfig, ChatMessage, ChatOptions, ChatResponse, ChatSession, StreamChunk, TokenState, DeviceCodeResponse, TokenResponse, PKCEPair, Tool, ToolCall, ToolResult, } from "./types";
|
|
4
4
|
import { QwenClient } from "./client";
|
|
5
5
|
export declare function createQwen(config?: {
|
|
6
6
|
accessToken?: string;
|
package/dist/index.js
CHANGED
|
@@ -243,19 +243,6 @@ ${url}
|
|
|
243
243
|
}
|
|
244
244
|
return result;
|
|
245
245
|
}
|
|
246
|
-
createImageMessage(text, imageUrls) {
|
|
247
|
-
const content = [
|
|
248
|
-
{ type: "text", text },
|
|
249
|
-
...imageUrls.map((url) => ({
|
|
250
|
-
type: "image_url",
|
|
251
|
-
image_url: { url }
|
|
252
|
-
}))
|
|
253
|
-
];
|
|
254
|
-
return {
|
|
255
|
-
role: "user",
|
|
256
|
-
content
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
246
|
setModel(model) {
|
|
260
247
|
this.model = model;
|
|
261
248
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,20 +3,9 @@ export interface QwenConfig {
|
|
|
3
3
|
refreshToken?: string;
|
|
4
4
|
model?: string;
|
|
5
5
|
}
|
|
6
|
-
export interface ImageContent {
|
|
7
|
-
type: "image_url";
|
|
8
|
-
image_url: {
|
|
9
|
-
url: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export interface TextContent {
|
|
13
|
-
type: "text";
|
|
14
|
-
text: string;
|
|
15
|
-
}
|
|
16
|
-
export type MessageContent = string | (TextContent | ImageContent)[];
|
|
17
6
|
export interface ChatMessage {
|
|
18
7
|
role: "system" | "user" | "assistant" | "tool";
|
|
19
|
-
content:
|
|
8
|
+
content: string | null;
|
|
20
9
|
tool_calls?: ToolCall[];
|
|
21
10
|
tool_call_id?: string;
|
|
22
11
|
}
|