LinkUp
LinkUp is an AI dev tool that helps you connect your code with your LLM. It’s a platform that allows you to connect your code with your LLM and get observability.
The Linkup integration allows you to search the web and include the results in your prompts. This is useful for providing up-to-date information to your models without having to manually search and paste content.
Check out the LinkUp website for more information.
1. Add Linkup Parameters to Your Request
Include linkup_params
in your API payload:
2. Use Template Variables in Your Messages
The Linkup response will be available as a variable named linkup_search_response
in your templates. You can access it using Jinja2 syntax:
3. Using with Prompts
If you’re using the Prompts feature, you can include the Linkup template variables in your prompt templates. When you make a request with linkup_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
The linkup_params
object supports the following parameters:
Parameter | Type | Description | Default |
---|---|---|---|
q | string | The search query | Required |
depth | string | The depth of the search ("shallow" or "deep" ) | "deep" |
outputType | string | The type of output ("sourcedAnswer" or "raw" ) | "sourcedAnswer" |
structuredOutputSchema | string | Schema for structured output | null |
includeImages | boolean | Whether to include images in the response | false |
Response Structure
The linkup_search_response
variable will contain:
Example
Here’s a complete example of using the Linkup integration:
With a prompt template like:
Error Handling
If there’s an error with the Linkup API call, it will be added to the warnings_dict
in the response with the key LINKUP_SEARCH_ERROR
.
Was this page helpful?