@ignore
(prompt: string, options: this['ParsedCallOptions'])
| 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, |
nothing calls this directly
no test coverage detected