Explore Docs (wip)
·
Discord
·
ð
·
LinkedIn
Name | About | Syntax |
---|---|---|
Prompt |
Send a message to the AI model and receive a response
Note: The prompt step uses Jinja templates and you can access context variables in them. |
```yaml - prompt: "Analyze the following data: {{agent.name}}" # <-- this is a jinja template ``` ```yaml - prompt: - role: system content: "You are {{agent.name}}. {{agent.about}}" - role: user content: "Analyze the following data: {{_.data}}" ``` |
Tool Call |
Execute an integrated tool or API that you have previously declared in the task.
Note: The tool call step uses Python expressions inside the arguments. |
```yaml - tool: web_search arguments: query: '"Latest AI developments"' # <-- this is a python expression (notice the quotes) num_results: len(_.topics) # <-- python expression to access the length of a list ``` |
Evaluate |
Perform calculations or manipulate data
Note: The evaluate step uses Python expressions. |
```yaml - evaluate: average_score: sum(scores) / len(scores) ``` |
Wait for Input |
Pause workflow until input is received. It accepts an `info` field that can be used by your application to collect input from the user.
Note: The wait_for_input step is useful when you want to pause the workflow and wait for user input e.g. to collect a response to a prompt. |
```yaml - wait_for_input: info: message: '"Please provide additional information about {_.required_info}."' # <-- python expression to access the context variable ``` |
Log |
Log a specified value or message.
Note: The log step uses Jinja templates and you can access context variables in them. |
```yaml - log: "Processing completed for item {{_.item_id}}" # <-- jinja template to access the context variable ``` |
Name | About | Syntax |
---|---|---|
Get | Retrieve a value from the execution's key-value store. | ```yaml - get: user_preference ``` |
Set |
Assign a value to a key in the execution's key-value store.
Note: The set step uses Python expressions. |
```yaml - set: user_preference: '"dark_mode"' # <-- python expression ``` |
Name | About | Syntax |
---|---|---|
Foreach | Iterate over a collection and perform steps for each item | ```yaml - foreach: in: _.data_list # <-- python expression to access the context variable do: - log: "Processing item {{_.item}}" # <-- jinja template to access the context variable ``` |
Map-Reduce | Map over a collection and reduce the results | ```yaml - map_reduce: over: _.numbers # <-- python expression to access the context variable map: - evaluate: squared: "_ ** 2" reduce: results + [_] # <-- (optional) python expression to reduce the results. This is the default if omitted. ``` ```yaml - map_reduce: over: _.topics map: - prompt: Write an essay on {{_}} parallelism: 10 ``` |
Parallel | Run multiple steps in parallel | ```yaml - parallel: - tool: web_search arguments: query: '"AI news"' - tool: weather_check arguments: location: '"New York"' ``` |
Name | About | Syntax |
---|---|---|
If-Else | Conditional execution of steps | ```yaml - if: _.score > 0.8 # <-- python expression then: - log: High score achieved else: - error: Score needs improvement ``` |
Switch | Execute steps based on multiple conditions | ```yaml - switch: - case: _.category == 'A' then: - log: "Category A processing" - case: _.category == 'B' then: - log: "Category B processing" - case: _ # Default case then: - error: Unknown category ``` |
Name | About | Syntax |
---|---|---|
Sleep | Pause the workflow for a specified duration | ```yaml - sleep: seconds: 30 # minutes: 1 # hours: 1 # days: 1 ``` |
Return |
Return a value from the workflow
Note: The return step uses Python expressions. |
```yaml - return: result: '"Task completed successfully"' # <-- python expression time: datetime.now().isoformat() # <-- python expression ``` |
Yield | Run a subworkflow and await its completion | ```yaml - yield: workflow: process_data arguments: input_data: _.raw_data # <-- python expression ``` |
Error | Handle errors by specifying an error message | ```yaml - error: "Invalid input provided" # <-- Strings only ``` |
Brave Search | ```yaml setup: api_key: string # The API key for Brave Search arguments: query: string # The search query for searching with Brave output: result: string # The result of the Brave Search ``` | **Example cookbook**: [cookbooks/02-sarcastic-news-headline-generator.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/02-sarcastic-news-headline-generator.ipynb) |
BrowserBase | ```yaml setup: api_key: string # The API key for BrowserBase project_id: string # The project ID for BrowserBase session_id: string # (Optional) The session ID for BrowserBase arguments: urls: list[string] # The URLs for loading with BrowserBase output: documents: list # The documents loaded from the URLs ``` | **Example cookbook**: [cookbooks/06-browser-use.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/06-browser-use.ipynb) |
```yaml setup: host: string # The host of the email server port: integer # The port of the email server user: string # The username of the email server password: string # The password of the email server arguments: to: string # The email address to send the email to from: string # The email address to send the email from subject: string # The subject of the email body: string # The body of the email output: success: boolean # Whether the email was sent successfully ``` | **Example cookbook**: [cookbooks/00-Devfest-Email-Assistant.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/00-Devfest-Email-Assistant.ipynb) | |
Spider | ```yaml setup: spider_api_key: string # The API key for Spider arguments: url: string # The URL for which to fetch data mode: string # The type of crawlers (default: "scrape") params: dict # (Optional) The parameters for the Spider API output: documents: list # The documents returned from the spider ``` | **Example cookbook**: [cookbooks/01-website-crawler.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/01-website-crawler.ipynb) |
Weather | ```yaml setup: openweathermap_api_key: string # The API key for OpenWeatherMap arguments: location: string # The location for which to fetch weather data output: result: string # The weather data for the specified location ``` | **Example cookbook**: [cookbooks/03-trip-planning-assistant.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/03-trip-planning-assistant.ipynb) |
Wikipedia | ```yaml arguments: query: string # The search query string load_max_docs: integer # (Optional) Maximum number of documents to load. Default is 2. output: documents: list # The documents returned from the Wikipedia search ``` | **Example cookbook**: [cookbooks/03-trip-planning-assistant.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/03-trip-planning-assistant.ipynb) |
FFmpeg | ```yaml arguments: cmd: string # The FFmpeg command to execute file: string # The base64 encoded file to process output: fileoutput: string # The output file from the FFmpeg command in base64 encoding result: boolean # Whether the FFmpeg command was executed successfully mime_type: string # The MIME type of the output file ``` | |
Llama Parse |
```yaml
setup:
llamaparse_api_key: string # The API key for Llama Parse
params: dict # (Optional) Additional parameters for the Llama Parse integration
arguments:
file: string | Array |
|
Cloudinary | ```yaml method: media_upload | media_edit # The method to use for the Cloudinary integration setup: cloudinary_cloud_name: string # Your Cloudinary cloud name cloudinary_api_key: string # Your Cloudinary API key cloudinary_api_secret: string # Your Cloudinary API secret params: dict # (Optional) Additional parameters for the Cloudinary integration arguments: file: string # The URL of the file upload. Only available for media_upload method. upload_params: dict # (Optional) Additional parameters for the upload. Only available for media_upload method. public_id: string # (Optional) The public ID for the file. For media_edit method it is MANDATORY. For media_upload method it is optional. Default is a random UUID. transformation: list[dict] # The transformations to apply to the file. Only available for media_edit method. return_base64: boolean # Whether to return the file in base64 encoding. Default is false. output: url: string # The URL of the uploaded file. Only available for media_upload method. meta_data: dict # Additional metadata from the upload response. Only available for media_upload method. public_id: string # The public ID of the uploaded file. Only available for media_upload method. transformed_url: string # (Optional) The transformed URL. Only available for media_edit method. base64: string # (Optional) The base64 encoded file if return_base64 is true. ``` | **Example cookbook**: [cookbooks/05-video-processing-with-natural-language.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/05-video-processing-with-natural-language.ipynb) |