ExternalGenerator
Call an external service with a prompt and return its response.
Key Features
- Sends a prompt to an external HTTP service and returns the results.
- Works as a drop-in replacement for LLM generators when using external services.
- Flexible regarding what constitutes a prompt — supports use cases like SQL queries sent to external databases.
- Passes optional metadata alongside the prompt to the external service.
- Configures a custom timeout for requests.
Configuration
- Drag the
ExternalGeneratorcomponent onto the canvas from the Component Library. - Click the component to open the configuration panel.
- On the General tab:
- Enter the url of the external service.
- Go to the Advanced tab to configure request headers and timeout.
Connections
ExternalGenerator accepts a prompt string and optional meta dictionary as input. It outputs a list of reply strings (replies) and a list of metadata dictionaries (meta).
Connect PromptBuilder to the prompt input to provide formatted instructions. Connect the replies output to DeepsetAnswerBuilder to build GeneratedAnswer objects.
Parameters
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. |
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?