1. Add Linkup Parameters to Your Request
Includelinkup_params
in your request’s keywordsai_params
:
2. Use Template Variables in Your Messages
The Linkup response will be available as a variable namedlinkup_search_response
in your templates. You can access it using Jinja2 syntax:
You can learn how to use Jinja2 syntax in the Jinja2 documentation.
3. Using with Prompts
If you’re using Keywords AI Prompts, you can include the Linkup template variables in your prompt templates. When you make a request withlinkup_params
, the variables will be populated and rendered in your prompt.
How It Works
-
When a request with
linkup_params
is received, the system:- Extracts the Linkup parameters from the request
- Calls the Linkup API to retrieve search results
- Adds the results to the template variables as
linkup_search_response
- Renders the prompt templates with these variables
-
If you’re using stored prompts, the system:
- Loads the prompt without rendering variables
- Merges variables from the prompt and the request
- Processes Linkup parameters and adds results to variables
- Renders the prompt with all variables, including Linkup results
Parameters
Thelinkup_params
object supports the following parameters:
Parameter | Type | Description | Default |
---|---|---|---|
q | string | The search query | Required |
depth | string | The depth of the search ("standard" or "deep" ) | "deep" |
outputType | string | The type of output ("searchResults" , "sourcedAnswer" or "structured" ) | "sourcedAnswer" |
structuredOutputSchema | string | Schema for structured output | null |
includeImages | boolean | Whether to include images in the response | false |
Response Structure
Thelinkup_search_response
variable will contain:
Example
Here’s a complete example of using the Linkup integration:Python
Error Handling
If there’s an error with the Linkup API call, it will be added to thewarnings_dict
in the response with the key LINKUP_SEARCH_ERROR
.