Straico Official icon

Straico Official

Get data from Straico API

Overview

The node integrates with the Straico API to interact with various resources such as agents, files, images, models, prompts, RAGs (Retrieval-Augmented Generation), and users. Specifically for the Agent resource with the Prompt Completion operation, it sends a user-defined prompt to a specified agent and retrieves a generated completion response.

This is useful in scenarios where you want to leverage an AI agent configured in Straico to generate text completions based on custom prompts. For example, you might use this to build chatbots, virtual assistants, or automated content generation workflows that query an AI agent with specific instructions or questions.

Properties

Name Meaning
Agent ID The unique identifier of the agent to which the prompt will be sent. Example: agent_123456789
Prompt The text prompt or question to send to the agent for completion.
Search Type The method used to search relevant information for the prompt. Options: Similarity, Mmr, Similarity_score_threshold
K Number of top results to consider in the search (integer).
Fetch_k Number of items to fetch before applying the search filter (integer).
Lambda_mult A multiplier parameter influencing the search or ranking algorithm (decimal number).
Score_threshold Threshold score to filter search results (decimal number).

Output

The output JSON contains the response from the Straico API after sending the prompt to the specified agent. It typically includes fields such as:

  • id: Identifier of the completion response.
  • message: The generated text completion from the agent.
  • model: The model used by the agent to generate the completion.
  • usage: Information about token usage or cost.
  • created_at: Timestamp of when the completion was created.

If the "Simplify" option is enabled (not shown in your properties but supported internally), the output is a simplified object containing only these key fields instead of the full raw response.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authenticating requests to the Straico API.
  • The node makes HTTP POST requests to endpoints like https://api.straico.com/v0/agent/{agent_id}/prompt.
  • Proper network access to Straico's API endpoint is necessary.
  • No additional environment variables are required beyond the API authentication setup.

Troubleshooting

  • Missing or invalid Agent ID: Ensure the Agent ID is correctly provided and corresponds to an existing agent in Straico.
  • API Authentication errors: Verify that the API key credential is valid and has sufficient permissions.
  • Invalid prompt or parameters: Check that the prompt string is not empty and numeric parameters like k, fetch_k, lambda_mult, and score_threshold are within acceptable ranges.
  • Unexpected API responses: If the API returns errors or unexpected data, review the Straico API documentation or contact support.
  • Network issues: Confirm that your n8n instance can reach https://api.straico.com.

Common error messages thrown by the node include missing binary data for file uploads (not applicable here) or invalid parameter combinations. For prompt completion, errors usually relate to missing required parameters or failed API calls.

Links and References

Discussion