MCPcopy
hub / github.com/FlowiseAI/Flowise / _call

Method _call

packages/components/nodes/llms/Replicate/core.ts:48–67  ·  view source on GitHub ↗

@ignore

(prompt: string, options: this['ParsedCallOptions'])

Source from the content-addressed store, hash-verified

46
47 /** @ignore */
48 async _call(prompt: string, options: this['ParsedCallOptions']): Promise<string> {
49 const replicate = await this._prepareReplicate()
50 const input = await this._getReplicateInput(replicate, prompt)
51
52 const output = await this.caller.callWithOptions({ signal: options.signal }, () =>
53 replicate.run(this.model, {
54 input
55 })
56 )
57
58 if (typeof output === 'string') {
59 return output
60 } else if (Array.isArray(output)) {
61 return output.join('')
62 } else {
63 // Note this is a little odd, but the output format is not consistent
64 // across models, so it makes some amount of sense.
65 return String(output)
66 }
67 }
68
69 async *_streamResponseChunks(
70 prompt: string,

Callers

nothing calls this directly

Calls 3

_prepareReplicateMethod · 0.95
_getReplicateInputMethod · 0.95
runMethod · 0.65

Tested by

no test coverage detected