1+ /* auto-generated by NAPI-RS */
2+ /* eslint-disable */
13export declare class LangModel {
24 static createLocal (
35 modelName : string ,
@@ -19,14 +21,13 @@ export declare class LangModelRunIterator {
1921 next ( ) : Promise < LanguageModelIteratorResult > ;
2022}
2123
22- export declare const enum APISpecification {
23- ChatCompletion = "ChatCompletion" ,
24- OpenAI = "OpenAI" ,
25- Gemini = "Gemini" ,
26- Claude = "Claude" ,
27- Responses = "Responses" ,
28- Grok = "Grok" ,
29- }
24+ export type APISpecification =
25+ | "ChatCompletion"
26+ | "OpenAI"
27+ | "Gemini"
28+ | "Claude"
29+ | "Responses"
30+ | "Grok" ;
3031
3132export interface CacheProgress {
3233 comment : string ;
@@ -35,24 +36,24 @@ export interface CacheProgress {
3536}
3637
3738export type FinishReason =
38- | { type : "Stop " }
39- | { type : "Length " }
40- | { type : "ToolCall " }
41- | { type : "Refusal " ; field0 : string } ;
39+ | { type : "stop " }
40+ | { type : "length " }
41+ | { type : "tool_call " }
42+ | { type : "refusal " ; reason : string } ;
4243
4344export type Grammar =
44- | { type : "Plain " }
45- | { type : "JSON " }
46- | { type : "JSONSchema " ; field0 : string }
47- | { type : "Regex " ; field0 : string }
48- | { type : "CFG " ; field0 : string } ;
45+ | { type : "plain " }
46+ | { type : "json " }
47+ | { type : "jsonschema " ; schema : string }
48+ | { type : "regex " ; regex : string }
49+ | { type : "cfg " ; cfg : string } ;
4950
5051export interface InferenceConfig {
51- thinkEffort : ThinkEffort ;
52+ thinkEffort ? : ThinkEffort ;
5253 temperature ?: number ;
5354 topP ?: number ;
5455 maxTokens ?: number ;
55- grammar : Grammar ;
56+ grammar ? : Grammar ;
5657}
5758
5859export interface LanguageModelIteratorResult {
@@ -62,82 +63,71 @@ export interface LanguageModelIteratorResult {
6263
6364export interface Message {
6465 role : Role ;
65- id ?: string ;
66- thinking : string ;
6766 contents : Array < Part > ;
68- toolCalls : Array < Part > ;
67+ id ?: string ;
68+ thinking ?: string ;
69+ tool_calls ?: Array < Part > ;
6970 signature ?: string ;
7071}
7172
7273export interface MessageDelta {
7374 role ?: Role ;
7475 id ?: string ;
75- thinking : string ;
76+ thinking ? : string ;
7677 contents : Array < PartDelta > ;
77- toolCalls : Array < PartDelta > ;
78+ tool_calls : Array < PartDelta > ;
7879 signature ?: string ;
7980}
8081
8182export interface MessageOutput {
8283 delta : MessageDelta ;
83- finishReason ?: FinishReason ;
84+ finish_reason ?: FinishReason ;
8485}
8586
8687export type Part =
87- | { type : "Text " ; text : string }
88- | { type : "Function " ; id ?: string ; f : PartFunction }
89- | { type : "Value " ; value : any }
90- | { type : "Image " ; image : PartImage } ;
88+ | { type : "text " ; text : string }
89+ | { type : "function " ; id ?: string ; function : PartFunction }
90+ | { type : "value " ; value : any }
91+ | { type : "image " ; image : PartImage } ;
9192
9293export type PartDelta =
93- | { type : "Text " ; text : string }
94- | { type : "Function " ; id ?: string ; f : PartDeltaFunction }
95- | { type : "Value " ; value : any }
96- | { type : "Null " } ;
94+ | { type : "text " ; text : string }
95+ | { type : "function " ; id ?: string ; function : PartDeltaFunction }
96+ | { type : "value " ; value : any }
97+ | { type : "null " } ;
9798
9899export type PartDeltaFunction =
99- | { type : "Verbatim " ; field0 : string }
100- | { type : "WithStringArgs " ; name : string ; args : string }
101- | { type : "WithParsedArgs " ; name : string ; args : any } ;
100+ | { type : "verbatim " ; text : string }
101+ | { type : "with_string_args " ; name : string ; arguments : string }
102+ | { type : "with_parsed_args " ; name : string ; arguments : any } ;
102103
103104export interface PartFunction {
104105 name : string ;
105- args : any ;
106+ arguments : any ;
106107}
107108
108109export type PartImage = {
109- type : "Binary " ;
110- h : number ;
111- w : number ;
112- c : PartImageColorspace ;
110+ type : "binary " ;
111+ height : number ;
112+ width : number ;
113+ colorspace : PartImageColorspace ;
113114 data : Buffer ;
114115} ;
115116
116- export declare const enum PartImageColorspace {
117- Grayscale = "Grayscale" ,
118- RGB = "RGB" ,
119- RGBA = "RGBA" ,
120- }
117+ export type PartImageColorspace = "grayscale" | "rgb" | "rgba" ;
121118
122119/** The author of a message (or streaming delta) in a chat. */
123- export declare const enum Role {
120+ export type Role =
124121 /** System instructions and constraints provided to the assistant. */
125- System = "System" ,
122+ | "system"
126123 /** Content authored by the end user. */
127- User = "User" ,
124+ | "user"
128125 /** Content authored by the assistant/model. */
129- Assistant = "Assistant" ,
126+ | "assistant"
130127 /** Outputs produced by external tools/functions */
131- Tool = "Tool" ,
132- }
128+ | "tool" ;
133129
134- export declare const enum ThinkEffort {
135- Disable = "Disable" ,
136- Enable = "Enable" ,
137- Low = "Low" ,
138- Medium = "Medium" ,
139- High = "High" ,
140- }
130+ export type ThinkEffort = "disable" | "enable" | "low" | "medium" | "high" ;
141131
142132export interface ToolDesc {
143133 name : string ;
0 commit comments