@auipage/model 0.2.0-alpha.2 → 0.2.0-beta.0
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/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.min.js +1 -1
- package/package.json +7 -4
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @auipage/model v0.2.0-
|
|
1
|
+
/*! @auipage/model v0.2.0-beta.0 */
|
|
2
2
|
"use strict";class t{constructor(){this._events=Object.create(null)}on(t,n){if("function"!=typeof n)return this;return(this._events[t]||(this._events[t]=[])).push(n),this}off(t,n){const e=this._events[t];if(!e)return this;const r=e.indexOf(n);return r>=0&&e.splice(r,1),0===e.length&&delete this._events[t],this}emit(t,...n){const e=this._events[t];if(!e||0===e.length)return!1;for(const t of e.slice())try{t.apply(null,n)}catch(t){console.error(t)}return!0}}class n extends t{constructor(){super(),this.status=0,this.headers={},this.ok=!1,this._done=!1,this._sseMode=!1,this._sseBuffer="",this._cancel=null,this._errorPending=null}on(t,n){if(super.on(t,n),"error"===t&&this._errorPending){const t=this._errorPending;this._errorPending=null,queueMicrotask(()=>this.emit("error",t))}return this}cancel(){return this._cancel&&this._cancel(),this}header(t){const n=this.headers;if(n)return"function"==typeof n.get?n.get(t)??void 0:n[t]}_push(t,n){if(!this._done||"error"===t){if("data"===t&&this._sseMode){this._sseBuffer+=n;const t=this._sseBuffer.split(/\r{0,1}\n\r{0,1}\n/);this._sseBuffer=t.pop();for(const n of t){const t=this._extractSSEData(n);null!==t&&this.emit("data",t)}return}if("end"===t){if(this._sseMode&&this._sseBuffer.trim()){const t=this._extractSSEData(this._sseBuffer);null!==t&&this.emit("data",t),this._sseBuffer=""}this._done=!0}if("error"===t){this._done=!0;const t=this._events&&this._events.error;if(!t||0===t.length)return void(this._errorPending=n)}this.emit(t,n)}}_extractSSEData(t){const n=[];for(const e of t.split("\n"))e.startsWith("data:")&&n.push(e.replace(/^data:\s*/,"").replace(/\r$/,""));return 0===n.length?null:n.join("\n")}}const e=function(t){return function(e){return new Promise((r,o)=>{if(!e||!e.url)return void o(new Error("fetch: options.url is required"));var s;s=e.body,"[object Object]"===Object.prototype.toString.call(s)&&(e=Object.assign({},e,{body:JSON.stringify(e.body)}));const i=new n,c="function"==typeof AbortController?new AbortController:null;let a=null,u=!1;i._cancel=()=>{c&&c.abort()},queueMicrotask(()=>r(i));const l=()=>{a&&(clearTimeout(a),a=null)},h={onResponse(t){if(t&&"number"==typeof t.status&&(i.status=t.status,i.ok=t.status>=200&&t.status<300),t&&t.headers){i.headers=t.headers;("function"==typeof t.headers.get&&t.headers.get("content-type")||t.headers["content-type"]||"").includes("text/event-stream")&&(i._sseMode=!0)}i.status>=400&&i.emit("http-error",{status:i.status,headers:i.headers})},onData(t){i._push("data",t)},onEnd(){l(),i._push("end")},onError(t){u||(u=!0,l(),i._push("error",t),o(t))}},f=t=>{c&&c.abort(),h.onError(t)};if(e.timeout>0&&(a=setTimeout(()=>{a=null,f(new Error("fetch: 请求超时("+e.timeout+"ms)"))},e.timeout)),e.signal){if(e.signal.aborted)return void f(new Error("fetch: 请求已取消"));e.signal.addEventListener("abort",()=>{f(new Error("fetch: 请求已取消"))})}const d=c?Object.assign({},e,{signal:c.signal}):e;let p;try{p=t(d,h)}catch(t){return void h.onError(t)}p&&"function"==typeof p.then&&p.then(null,h.onError)})}}("undefined"!=typeof window&&void 0!==window.document?function(t,{onData:n,onEnd:e,onError:r,onResponse:o}){const{url:s,method:i="GET",headers:c={},body:a,signal:u}=t;"function"==typeof fetch?fetch(s,{method:i,headers:c,body:a,signal:u}).then(async t=>{if("function"==typeof o&&o({status:t.status||0,headers:t.headers||{}}),!t.body)return void e();const s=t.body.getReader(),i=new TextDecoder("utf-8");(async()=>{try{for(;;){const{value:t,done:r}=await s.read();if(r)return void e();n(i.decode(t,{stream:!0}))}}catch(t){r(t)}})()}).catch(t=>r(t)):r(new Error("Global fetch is not available in this environment"))}:async function(t,{onData:n,onEnd:e,onError:r,onResponse:o}){const[{default:s},{default:i},{URL:c}]=await Promise.all([import("http"),import("https"),import("url")]),{url:a,method:u="GET",headers:l={},body:h,signal:f}=t;let d;try{d=new c(a)}catch(t){return void r(t)}const p="https:"===d.protocol,g=p?i:s,m={method:u,hostname:d.hostname,port:d.port||(p?443:80),path:d.pathname+d.search,headers:l},y=g.request(m,t=>{"function"==typeof o&&o({status:t.statusCode||0,headers:t.headers||{}}),t.setEncoding("utf8"),t.on("data",t=>n(t)),t.on("end",()=>e()),t.on("error",t=>r(t))});if(y.on("error",t=>r(t)),f){if(f.aborted)return void r(new Error("请求已取消"));f.addEventListener("abort",()=>{y.destroy(new Error("请求已取消"))})}null!=h&&y.write(h),y.end()});function r(t){return t.replace(/^data:\s*/,"")}function o(t){try{return{value:JSON.parse(t)}}catch(t){return null}}function s(t,n){const e=o(r(t.trim()));if(!e)throw new SyntaxError("模型返回无法解析:"+String(n).slice(0,120));return e.value}function i(t){if(Array.isArray(t)){for(const n of t)if(n&&n.error)throw n.error;return t}if(t&&t.error)throw t.error;return t}function c(t){let n=String(null==t?"":t).trim();if(n=n.replace(/data:\s*\[DONE\]$/,"").trim(),""===n||"[DONE]"===n)return[];let e=o(r(n))||o(n);if(e)return i(e.value);const c=n.split(/\r?\n\r?\ndata: /);if(c.length>1)return i(c.map(t=>s(t,n)));const a=n.split(/\r?\n/).filter(t=>t.trim()&&!t.trim().startsWith(":"));if(a.length>1)return i(a.map(t=>s(t,n)));throw new SyntaxError("模型返回无法解析:"+n.slice(0,120))}function a(t,n){if(!/<\/think>/.test(t))return t;const e=t.split("</think>");return{reasoning:e[0].replace("<think>",""),content:e[1]+(n||"")}}const u="<think>",l="</think>";function h(t,n){for(let e=Math.min(n.length-1,t.length);e>0;e--)if(t.endsWith(n.slice(0,e)))return e;return 0}function f(t,n){const e=(n.thinkBuf||"")+t;if(n.thinkBuf="",n.inThink){const t=e.indexOf(l);if(-1===t){const t=h(e,l);return n.thinkBuf=e.slice(e.length-t),{thinking:e.slice(0,e.length-t),content:""}}n.inThink=!1;const r=f(e.slice(t+8),n);return{thinking:e.slice(0,t)+r.thinking,content:r.content}}const r=e.indexOf(u);if(-1===r){const t=h(e,u);return n.thinkBuf=e.slice(e.length-t),{thinking:"",content:e.slice(0,e.length-t)}}const o=e.indexOf(l,r);if(-1!==o){const t=f(e.slice(o+8),n);return{thinking:e.slice(r+7,o)+t.thinking,content:e.slice(0,r)+t.content}}n.inThink=!0;const s=e.slice(r+7),i=h(s,l);return n.thinkBuf=s.slice(s.length-i),{thinking:s.slice(0,s.length-i),content:e.slice(0,r)}}function d(t){const n=t.function||{};return{...t,function:{...n,arguments:"string"==typeof n.arguments?n.arguments:""}}}function p(t,n){t._toolSlots||(t._toolSlots=new Map);const e=t.tool_calls,r="number"==typeof n.index?n.index:null;if("string"==typeof n.id&&""!==n.id){const o=e.find(t=>t.id===n.id);if(o)return void g(o,n);const s=d(n);return e.push(s),void(null!==r&&t._toolSlots.set(r,s))}let o=null!==r?t._toolSlots.get(r):null;if(!o&&e.length&&(o=e[e.length-1]),!o)return o=d(n),e.push(o),void(null!==r&&t._toolSlots.set(r,o));g(o,n)}function g(t,n){const e=n.function||{};e.name&&!t.function.name&&(t.function.name=e.name),"string"==typeof e.arguments&&(t.function.arguments+=e.arguments)}function m(t,{logback:n,thinkback:e},r){if(Array.isArray(t))for(let o=0;o<t.length;o++){const s=t[o].delta;let i=s.reasoning||s.reasoning_content;if(i){const t=a(i,s.content);"object"==typeof t&&(i=t.reasoning,s.content=t.content),e&&e(i)}if(s.content){const t=f(s.content,r);t.thinking&&e&&e(t.thinking),t.content&&(n&&n(t.content),r.content+=t.content)}if(Array.isArray(s.tool_calls))for(const t of s.tool_calls)p(r,t)}}function y(t,n){const e=t&&t.status;let r="";if(n){try{const t=JSON.parse(n),e=t&&t.error;r=e&&(e.message||e)||""}catch(t){r=String(n).slice(0,200)}r&&"string"!=typeof r&&(r=JSON.stringify(r))}return new Error("模型服务返回 HTTP "+e+(r?":"+r:""))}function _(t){this.model=t.model,this.apiKey=t.apiKey,this.baseURL=t.baseURL,this.temperature=t.temperature,this.topP=t.topP,this.maxTokens=t.maxTokens,this.timeout=t.timeout}_.prototype.completions=function(t,n,r){return new Promise((o,s)=>{const i={content:"",tool_calls:[]},a={logback:n,thinkback:r};let u="",l=null,h=null,f=!1;const d=(t,n)=>{f||(f=!0,t(n))},p=t=>d(s,function(t,n){if(t instanceof Error)return t;if(t&&"string"==typeof t.message)return new Error(t.message);try{return new Error(String(t))}catch(t){return new Error(n||"模型请求失败")}}(t,"模型请求失败")),g={model:this.model,messages:t.messages,tools:t.tools?t.tools.map(t=>t.description):[],stream:t.stream},_=null!=t.temperature?t.temperature:this.temperature,k=null!=t.topP?t.topP:this.topP,b=null!=t.maxTokens?t.maxTokens:this.maxTokens;null!=_&&(g.temperature=_),null!=k&&(g.top_p=k),null!=b&&(g.max_tokens=b),e({url:`${this.baseURL.replace(/\/+$/,"")}/chat/completions`,method:"POST",headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify(g),timeout:null!=t.timeout?t.timeout:this.timeout,signal:t.signal}).then(n=>{n.on("http-error",n=>{l=n,t.stream&&p(y(n))}),n.on("data",n=>{if(f)return;if(!t.stream)return void(u+=n);let e;try{e=c(n.toString())}catch(t){return h=t,void p(t)}try{const t=Array.isArray(e)?e:[e];for(const n of t)m(n.choices,a,i)}catch(t){p(t)}}),n.on("end",()=>{if(t.stream){if(h)return void p(h);if(l)return void p(y(l))}else{if(l)return void p(y(l,u));try{const t=c(u),n=t&&t.choices;if(!n||!n[0]||!n[0].message)throw new Error("模型响应缺少 choices[0].message");m([{delta:n[0].message}],a,i)}catch(t){return void p(t)}}!function(t,{logback:n,thinkback:e}){const r=function(t){const n=t.thinkBuf||"";return t.thinkBuf="",t.inThink?{thinking:n,content:""}:{thinking:"",content:n}}(t);r.thinking&&e&&e(r.thinking),r.content&&(n&&n(r.content),t.content+=r.content)}(i,a),d(o,{content:i.content,tool_calls:i.tool_calls})}),n.on("error",t=>p(t))}).catch(t=>p(t))})},exports.Model=_;
|
package/dist/index.js
CHANGED
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @auipage/model v0.2.0-
|
|
1
|
+
/*! @auipage/model v0.2.0-beta.0 */
|
|
2
2
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).auipage_model={})}(this,function(t){"use strict";class e{constructor(){this._events=Object.create(null)}on(t,e){if("function"!=typeof e)return this;return(this._events[t]||(this._events[t]=[])).push(e),this}off(t,e){const n=this._events[t];if(!n)return this;const r=n.indexOf(e);return r>=0&&n.splice(r,1),0===n.length&&delete this._events[t],this}emit(t,...e){const n=this._events[t];if(!n||0===n.length)return!1;for(const t of n.slice())try{t.apply(null,e)}catch(t){console.error(t)}return!0}}class n extends e{constructor(){super(),this.status=0,this.headers={},this.ok=!1,this._done=!1,this._sseMode=!1,this._sseBuffer="",this._cancel=null,this._errorPending=null}on(t,e){if(super.on(t,e),"error"===t&&this._errorPending){const t=this._errorPending;this._errorPending=null,queueMicrotask(()=>this.emit("error",t))}return this}cancel(){return this._cancel&&this._cancel(),this}header(t){const e=this.headers;if(e)return"function"==typeof e.get?e.get(t)??void 0:e[t]}_push(t,e){if(!this._done||"error"===t){if("data"===t&&this._sseMode){this._sseBuffer+=e;const t=this._sseBuffer.split(/\r{0,1}\n\r{0,1}\n/);this._sseBuffer=t.pop();for(const e of t){const t=this._extractSSEData(e);null!==t&&this.emit("data",t)}return}if("end"===t){if(this._sseMode&&this._sseBuffer.trim()){const t=this._extractSSEData(this._sseBuffer);null!==t&&this.emit("data",t),this._sseBuffer=""}this._done=!0}if("error"===t){this._done=!0;const t=this._events&&this._events.error;if(!t||0===t.length)return void(this._errorPending=e)}this.emit(t,e)}}_extractSSEData(t){const e=[];for(const n of t.split("\n"))n.startsWith("data:")&&e.push(n.replace(/^data:\s*/,"").replace(/\r$/,""));return 0===e.length?null:e.join("\n")}}const r=function(t){return function(e){return new Promise((r,o)=>{if(!e||!e.url)return void o(new Error("fetch: options.url is required"));var s;s=e.body,"[object Object]"===Object.prototype.toString.call(s)&&(e=Object.assign({},e,{body:JSON.stringify(e.body)}));const i=new n,c="function"==typeof AbortController?new AbortController:null;let a=null,u=!1;i._cancel=()=>{c&&c.abort()},queueMicrotask(()=>r(i));const l=()=>{a&&(clearTimeout(a),a=null)},h={onResponse(t){if(t&&"number"==typeof t.status&&(i.status=t.status,i.ok=t.status>=200&&t.status<300),t&&t.headers){i.headers=t.headers;("function"==typeof t.headers.get&&t.headers.get("content-type")||t.headers["content-type"]||"").includes("text/event-stream")&&(i._sseMode=!0)}i.status>=400&&i.emit("http-error",{status:i.status,headers:i.headers})},onData(t){i._push("data",t)},onEnd(){l(),i._push("end")},onError(t){u||(u=!0,l(),i._push("error",t),o(t))}},f=t=>{c&&c.abort(),h.onError(t)};if(e.timeout>0&&(a=setTimeout(()=>{a=null,f(new Error("fetch: 请求超时("+e.timeout+"ms)"))},e.timeout)),e.signal){if(e.signal.aborted)return void f(new Error("fetch: 请求已取消"));e.signal.addEventListener("abort",()=>{f(new Error("fetch: 请求已取消"))})}const d=c?Object.assign({},e,{signal:c.signal}):e;let p;try{p=t(d,h)}catch(t){return void h.onError(t)}p&&"function"==typeof p.then&&p.then(null,h.onError)})}}("undefined"!=typeof window&&void 0!==window.document?function(t,{onData:e,onEnd:n,onError:r,onResponse:o}){const{url:s,method:i="GET",headers:c={},body:a,signal:u}=t;"function"==typeof fetch?fetch(s,{method:i,headers:c,body:a,signal:u}).then(async t=>{if("function"==typeof o&&o({status:t.status||0,headers:t.headers||{}}),!t.body)return void n();const s=t.body.getReader(),i=new TextDecoder("utf-8");(async()=>{try{for(;;){const{value:t,done:r}=await s.read();if(r)return void n();e(i.decode(t,{stream:!0}))}}catch(t){r(t)}})()}).catch(t=>r(t)):r(new Error("Global fetch is not available in this environment"))}:async function(t,{onData:e,onEnd:n,onError:r,onResponse:o}){const[{default:s},{default:i},{URL:c}]=await Promise.all([import("http"),import("https"),import("url")]),{url:a,method:u="GET",headers:l={},body:h,signal:f}=t;let d;try{d=new c(a)}catch(t){return void r(t)}const p="https:"===d.protocol,g=p?i:s,m={method:u,hostname:d.hostname,port:d.port||(p?443:80),path:d.pathname+d.search,headers:l},y=g.request(m,t=>{"function"==typeof o&&o({status:t.statusCode||0,headers:t.headers||{}}),t.setEncoding("utf8"),t.on("data",t=>e(t)),t.on("end",()=>n()),t.on("error",t=>r(t))});if(y.on("error",t=>r(t)),f){if(f.aborted)return void r(new Error("请求已取消"));f.addEventListener("abort",()=>{y.destroy(new Error("请求已取消"))})}null!=h&&y.write(h),y.end()});function o(t){return t.replace(/^data:\s*/,"")}function s(t){try{return{value:JSON.parse(t)}}catch(t){return null}}function i(t,e){const n=s(o(t.trim()));if(!n)throw new SyntaxError("模型返回无法解析:"+String(e).slice(0,120));return n.value}function c(t){if(Array.isArray(t)){for(const e of t)if(e&&e.error)throw e.error;return t}if(t&&t.error)throw t.error;return t}function a(t){let e=String(null==t?"":t).trim();if(e=e.replace(/data:\s*\[DONE\]$/,"").trim(),""===e||"[DONE]"===e)return[];let n=s(o(e))||s(e);if(n)return c(n.value);const r=e.split(/\r?\n\r?\ndata: /);if(r.length>1)return c(r.map(t=>i(t,e)));const a=e.split(/\r?\n/).filter(t=>t.trim()&&!t.trim().startsWith(":"));if(a.length>1)return c(a.map(t=>i(t,e)));throw new SyntaxError("模型返回无法解析:"+e.slice(0,120))}function u(t,e){if(!/<\/think>/.test(t))return t;const n=t.split("</think>");return{reasoning:n[0].replace("<think>",""),content:n[1]+(e||"")}}const l="<think>",h="</think>";function f(t,e){for(let n=Math.min(e.length-1,t.length);n>0;n--)if(t.endsWith(e.slice(0,n)))return n;return 0}function d(t,e){const n=(e.thinkBuf||"")+t;if(e.thinkBuf="",e.inThink){const t=n.indexOf(h);if(-1===t){const t=f(n,h);return e.thinkBuf=n.slice(n.length-t),{thinking:n.slice(0,n.length-t),content:""}}e.inThink=!1;const r=d(n.slice(t+8),e);return{thinking:n.slice(0,t)+r.thinking,content:r.content}}const r=n.indexOf(l);if(-1===r){const t=f(n,l);return e.thinkBuf=n.slice(n.length-t),{thinking:"",content:n.slice(0,n.length-t)}}const o=n.indexOf(h,r);if(-1!==o){const t=d(n.slice(o+8),e);return{thinking:n.slice(r+7,o)+t.thinking,content:n.slice(0,r)+t.content}}e.inThink=!0;const s=n.slice(r+7),i=f(s,h);return e.thinkBuf=s.slice(s.length-i),{thinking:s.slice(0,s.length-i),content:n.slice(0,r)}}function p(t){const e=t.function||{};return{...t,function:{...e,arguments:"string"==typeof e.arguments?e.arguments:""}}}function g(t,e){t._toolSlots||(t._toolSlots=new Map);const n=t.tool_calls,r="number"==typeof e.index?e.index:null;if("string"==typeof e.id&&""!==e.id){const o=n.find(t=>t.id===e.id);if(o)return void m(o,e);const s=p(e);return n.push(s),void(null!==r&&t._toolSlots.set(r,s))}let o=null!==r?t._toolSlots.get(r):null;if(!o&&n.length&&(o=n[n.length-1]),!o)return o=p(e),n.push(o),void(null!==r&&t._toolSlots.set(r,o));m(o,e)}function m(t,e){const n=e.function||{};n.name&&!t.function.name&&(t.function.name=n.name),"string"==typeof n.arguments&&(t.function.arguments+=n.arguments)}function y(t,{logback:e,thinkback:n},r){if(Array.isArray(t))for(let o=0;o<t.length;o++){const s=t[o].delta;let i=s.reasoning||s.reasoning_content;if(i){const t=u(i,s.content);"object"==typeof t&&(i=t.reasoning,s.content=t.content),n&&n(i)}if(s.content){const t=d(s.content,r);t.thinking&&n&&n(t.thinking),t.content&&(e&&e(t.content),r.content+=t.content)}if(Array.isArray(s.tool_calls))for(const t of s.tool_calls)g(r,t)}}function _(t,e){const n=t&&t.status;let r="";if(e){try{const t=JSON.parse(e),n=t&&t.error;r=n&&(n.message||n)||""}catch(t){r=String(e).slice(0,200)}r&&"string"!=typeof r&&(r=JSON.stringify(r))}return new Error("模型服务返回 HTTP "+n+(r?":"+r:""))}function k(t){this.model=t.model,this.apiKey=t.apiKey,this.baseURL=t.baseURL,this.temperature=t.temperature,this.topP=t.topP,this.maxTokens=t.maxTokens,this.timeout=t.timeout}k.prototype.completions=function(t,e,n){return new Promise((o,s)=>{const i={content:"",tool_calls:[]},c={logback:e,thinkback:n};let u="",l=null,h=null,f=!1;const d=(t,e)=>{f||(f=!0,t(e))},p=t=>d(s,function(t,e){if(t instanceof Error)return t;if(t&&"string"==typeof t.message)return new Error(t.message);try{return new Error(String(t))}catch(t){return new Error(e||"模型请求失败")}}(t,"模型请求失败")),g={model:this.model,messages:t.messages,tools:t.tools?t.tools.map(t=>t.description):[],stream:t.stream},m=null!=t.temperature?t.temperature:this.temperature,k=null!=t.topP?t.topP:this.topP,b=null!=t.maxTokens?t.maxTokens:this.maxTokens;null!=m&&(g.temperature=m),null!=k&&(g.top_p=k),null!=b&&(g.max_tokens=b),r({url:`${this.baseURL.replace(/\/+$/,"")}/chat/completions`,method:"POST",headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify(g),timeout:null!=t.timeout?t.timeout:this.timeout,signal:t.signal}).then(e=>{e.on("http-error",e=>{l=e,t.stream&&p(_(e))}),e.on("data",e=>{if(f)return;if(!t.stream)return void(u+=e);let n;try{n=a(e.toString())}catch(t){return h=t,void p(t)}try{const t=Array.isArray(n)?n:[n];for(const e of t)y(e.choices,c,i)}catch(t){p(t)}}),e.on("end",()=>{if(t.stream){if(h)return void p(h);if(l)return void p(_(l))}else{if(l)return void p(_(l,u));try{const t=a(u),e=t&&t.choices;if(!e||!e[0]||!e[0].message)throw new Error("模型响应缺少 choices[0].message");y([{delta:e[0].message}],c,i)}catch(t){return void p(t)}}!function(t,{logback:e,thinkback:n}){const r=function(t){const e=t.thinkBuf||"";return t.thinkBuf="",t.inThink?{thinking:e,content:""}:{thinking:"",content:e}}(t);r.thinking&&n&&n(r.thinking),r.content&&(e&&e(r.content),t.content+=r.content)}(i,c),d(o,{content:i.content,tool_calls:i.tool_calls})}),e.on("error",t=>p(t))}).catch(t=>p(t))})},t.Model=k});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auipage/model",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-beta.0",
|
|
4
4
|
"description": "@auipage/model",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
"types/",
|
|
23
23
|
"CHANGELOG",
|
|
24
24
|
"AUTHORS.txt",
|
|
25
|
-
".mailmap"
|
|
25
|
+
".mailmap",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"README.md",
|
|
28
|
+
"package.json"
|
|
26
29
|
],
|
|
27
30
|
"scripts": {
|
|
28
31
|
"prepublishOnly": "node ../../scripts/swap-pkg.js --mode=publish",
|
|
@@ -48,7 +51,7 @@
|
|
|
48
51
|
},
|
|
49
52
|
"homepage": "https://github.com/handless-ui/auipage#readme",
|
|
50
53
|
"dependencies": {
|
|
51
|
-
"@auipage/fetch": "^0.2.0-
|
|
52
|
-
"@auipage/types": "^0.2.0-
|
|
54
|
+
"@auipage/fetch": "^0.2.0-beta.0",
|
|
55
|
+
"@auipage/types": "^0.2.0-beta.0"
|
|
53
56
|
}
|
|
54
57
|
}
|