ExternalGenerator
Call an external service with a prompt.
Basic Information
- Type:
deepset_cloud_custom_nodes.generators.external.ExternalGenerator - Components it can connect with:
PromptBuilder:ExternalGeneratorreceives the prompt fromPromptBuilder.DeepsetAnswerBuilder:ExternalGeneratorsends the replies it received from the service toDeepsetAnswerBuilder, which uses them to buildGeneratedAnswerobjects.
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| prompt | str | The prompt to pass to the service. | |
| meta | Optional[Dict] | None | Additional metadata related to the prompt. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| replies | List[str] | The answers from the service. | |
| meta | List[Dict[str, Any]] | Metadata related to the answers. |
Overview
ExternalGenerator sends a prompt to an external service and returns the results from the service. It expects the service to respond with answer: str, meta: Dict. It acts just like any other Generator except that instead of calling an LLM it calls an external service.
ExternalGenerator is very flexible regarding what constitutes a prompt and what the external service does with it.
For example, this component can send a SQL query as a prompt to be run on a database in an external service.
Usage Example
Initializing the Component
components:
ExternalGenerator:
type: generators.external.ExternalGenerator
init_parameters:
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | str | The URL of the external service to post the prompt to. | |
| timeout | int | 50 | The timeout for requests sent to the URL. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
| prompt | str | The prompt to pass to the service. | |
| meta | Optional[Dict] | None | Additional metadata related to the prompt. |
Was this page helpful?