@mcp-use/inspector 0.4.8-canary.1 → 0.4.8
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/assets/{api_chain-BtB7Z_4X.js → api_chain-C0mKKL88.js} +1 -1
- package/dist/client/assets/{combine_docs_chain-C7bwcZYY.js → combine_docs_chain-DHevtaAw.js} +1 -1
- package/dist/client/assets/{few_shot-DAKE91M6.js → few_shot-AdF0HoUv.js} +1 -1
- package/dist/client/assets/{index-DORPiuTx.js → index-0U1BIuub.js} +3 -3
- package/dist/client/assets/{index-Czaq7z7C.js → index-BkNaLKWX.js} +5 -5
- package/dist/client/assets/{index-Cg_6x5Tz.js → index-BlE2b2g_.js} +4 -4
- package/dist/client/assets/index-BwZv8ceY.js +4 -0
- package/dist/client/assets/{index-Oj4NunKp.js → index-D5y2wvxm.js} +1 -1
- package/dist/client/assets/{index-BGdD6PBO.js → index-DfC3wdMF.js} +6 -6
- package/dist/client/assets/{json-YxLUFseT.js → json-t1uATdRl.js} +2 -2
- package/dist/client/assets/{langfuse-YA2S23SM-CZcFUChs.js → langfuse-YA2S23SM-CoLiMp6b.js} +5 -5
- package/dist/client/assets/llm_chain-DntCr9yG.js +1 -0
- package/dist/client/assets/{sequential_chain-B91Y995K.js → sequential_chain-CihdaIiG.js} +1 -1
- package/dist/client/assets/types-C379N3Mq.js +81 -0
- package/dist/client/assets/{vector_db_qa-DML6FKEk.js → vector_db_qa-BPAe9KNo.js} +2 -2
- package/dist/client/assets/{zodToJsonSchema-BVPLN4C-.js → zodToJsonSchema-BYFUjmxr.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +2 -2
- package/dist/client/assets/console-DDS3K5Ym.js +0 -44
- package/dist/client/assets/index-B7W7j4O5.js +0 -4
- package/dist/client/assets/llm_chain-B48Bg8ro.js +0 -1
- package/dist/client/assets/types-lqem5Hl5.js +0 -38
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{P as u,a as c}from"./langfuse-YA2S23SM-
|
|
1
|
+
import{P as u,a as c}from"./langfuse-YA2S23SM-CoLiMp6b.js";import{LLMChain as r}from"./llm_chain-DntCr9yG.js";import"./zodToJsonSchema-BYFUjmxr.js";import"./index-0U1BIuub.js";import"./deep-compare-strict-DtUHXpbW.js";import"./v4-BKrj-4V8.js";const p=`You are given the below API Documentation:
|
|
2
2
|
{api_docs}
|
|
3
3
|
Using this documentation, generate the full API url to call for answering the user question.
|
|
4
4
|
You should build the API url in order to get a response that is as short as possible, while still getting the necessary information to answer the question. Pay attention to deliberately exclude any unnecessary pieces of data in the API call.
|
package/dist/client/assets/{combine_docs_chain-C7bwcZYY.js → combine_docs_chain-DHevtaAw.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./zodToJsonSchema-
|
|
1
|
+
import"./zodToJsonSchema-BYFUjmxr.js";import{a as h,P as w}from"./langfuse-YA2S23SM-CoLiMp6b.js";import{LLMChain as l}from"./llm_chain-DntCr9yG.js";import"./index-0U1BIuub.js";import"./deep-compare-strict-DtUHXpbW.js";import"./v4-BKrj-4V8.js";class p extends h{static lc_name(){return"StuffDocumentsChain"}get inputKeys(){return[this.inputKey,...this.llmChain.inputKeys].filter(e=>e!==this.documentVariableName)}get outputKeys(){return this.llmChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),this.llmChain=e.llmChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey}_prepInputs(e){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:t,...i}=e,r=t.map(({pageContent:u})=>u).join(`
|
|
2
2
|
|
|
3
3
|
`);return{...i,[this.documentVariableName]:r}}async _call(e,t){return await this.llmChain.call(this._prepInputs(e),t?.getChild("combine_documents"))}_chainType(){return"stuff_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");return new p({llmChain:await l.deserialize(e.llm_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize()}}}class f extends h{static lc_name(){return"MapReduceDocumentsChain"}get inputKeys(){return[this.inputKey,...this.combineDocumentChain.inputKeys]}get outputKeys(){return this.combineDocumentChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"returnIntermediateSteps",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"maxIterations",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"ensureMapStep",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"combineDocumentChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llmChain=e.llmChain,this.combineDocumentChain=e.combineDocumentChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.ensureMapStep=e.ensureMapStep??this.ensureMapStep,this.inputKey=e.inputKey??this.inputKey,this.maxTokens=e.maxTokens??this.maxTokens,this.maxIterations=e.maxIterations??this.maxIterations,this.returnIntermediateSteps=e.returnIntermediateSteps??!1}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e;let r=i,u=[];for(let c=0;c<this.maxIterations;c+=1){const m=r.map(s=>({[this.documentVariableName]:s.pageContent,...n}));if(c!==0||!this.ensureMapStep){const s=await this.combineDocumentChain.llmChain.prompt.format(this.combineDocumentChain._prepInputs({[this.combineDocumentChain.inputKey]:r,...n}));if(await this.combineDocumentChain.llmChain._getNumTokens(s)<this.maxTokens)break}const b=await this.llmChain.apply(m,t?Array.from({length:m.length},(s,d)=>t.getChild(`map_${d+1}`)):void 0),{outputKey:y}=this.llmChain;this.returnIntermediateSteps&&(u=u.concat(b.map(s=>s[y]))),r=b.map(s=>({pageContent:s[y],metadata:{}}))}const a={[this.combineDocumentChain.inputKey]:r,...n},o=await this.combineDocumentChain.call(a,t?.getChild("combine_documents"));return this.returnIntermediateSteps?{...o,intermediateSteps:u}:o}_chainType(){return"map_reduce_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");if(!e.combine_document_chain)throw new Error("Missing combine_document_chain");return new f({llmChain:await l.deserialize(e.llm_chain),combineDocumentChain:await p.deserialize(e.combine_document_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),combine_document_chain:this.combineDocumentChain.serialize()}}}class _ extends h{static lc_name(){return"RefineDocumentsChain"}get defaultDocumentPrompt(){return new w({inputVariables:["page_content"],template:"{page_content}"})}get inputKeys(){return[...new Set([this.inputKey,...this.llmChain.inputKeys,...this.refineLLMChain.inputKeys])].filter(e=>e!==this.documentVariableName&&e!==this.initialResponseName)}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output_text"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"initialResponseName",{enumerable:!0,configurable:!0,writable:!0,value:"existing_answer"}),Object.defineProperty(this,"refineLLMChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"documentPrompt",{enumerable:!0,configurable:!0,writable:!0,value:this.defaultDocumentPrompt}),this.llmChain=e.llmChain,this.refineLLMChain=e.refineLLMChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.documentPrompt=e.documentPrompt??this.documentPrompt,this.initialResponseName=e.initialResponseName??this.initialResponseName}async _constructInitialInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};return this.documentPrompt.inputVariables.forEach(a=>{n[a]=i[a]}),{...{[this.documentVariableName]:await this.documentPrompt.format({...n})},...t}}async _constructRefineInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(a=>{n[a]=i[a]});const r={[this.documentVariableName]:await this.documentPrompt.format({...n})};return{[this.initialResponseName]:t,...r}}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e,r=i,u=await this._constructInitialInputs(r[0],n);let a=await this.llmChain.predict({...u},t?.getChild("answer"));for(let o=1;o<r.length;o+=1){const m={...await this._constructRefineInputs(r[o],a),...n};a=await this.refineLLMChain.predict({...m},t?.getChild("refine"))}return{[this.outputKey]:a}}_chainType(){return"refine_documents_chain"}static async deserialize(e){const t=e.llm_chain;if(!t)throw new Error("Missing llm_chain");const i=e.refine_llm_chain;if(!i)throw new Error("Missing refine_llm_chain");return new _({llmChain:await l.deserialize(t),refineLLMChain:await l.deserialize(i)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),refine_llm_chain:this.refineLLMChain.serialize()}}}export{f as MapReduceDocumentsChain,_ as RefineDocumentsChain,p as StuffDocumentsChain};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{B as p,c as n,r as o,P as u}from"./langfuse-YA2S23SM-
|
|
1
|
+
import{B as p,c as n,r as o,P as u}from"./langfuse-YA2S23SM-CoLiMp6b.js";import"./zodToJsonSchema-BYFUjmxr.js";import"./index-0U1BIuub.js";import"./deep-compare-strict-DtUHXpbW.js";import"./v4-BKrj-4V8.js";class l extends p{constructor(e){if(super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:`
|
|
2
2
|
|
|
3
3
|
`}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.assign(this,e),this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let t=this.inputVariables;this.partialVariables&&(t=t.concat(Object.keys(this.partialVariables))),n(this.prefix+this.suffix,this.templateFormat,t)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(e){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(e){const t=this.inputVariables.filter(i=>!(i in e)),a={...this.partialVariables??{},...e},r={...this,inputVariables:t,partialVariables:a};return new l(r)}async format(e){const t=await this.mergePartialAndUserVariables(e),a=await this.getExamples(t),r=await Promise.all(a.map(s=>this.examplePrompt.format(s))),i=[this.prefix,...r,this.suffix].join(this.exampleSeparator);return o(i,this.templateFormat,t)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(this.outputParser!==void 0)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(e){const{example_prompt:t}=e;if(!t)throw new Error("Missing example prompt");const a=await u.deserialize(t);let r;if(Array.isArray(e.examples))r=e.examples;else throw new Error("Invalid examples format. Only list or string are supported.");return new l({inputVariables:e.input_variables,examplePrompt:a,examples:r,exampleSeparator:e.example_separator,prefix:e.prefix,suffix:e.suffix,templateFormat:e.template_format})}}export{l as FewShotPromptTemplate};
|