302.AI icon

302.AI

Interact with 302.AI AI services

Chat

AI-generated

Overview

This node integrates with the 302.AI service to send chat messages to AI models and receive generated responses. It is designed for conversational AI use cases where users want to interact with advanced language models for tasks such as customer support, content generation, brainstorming, or virtual assistant functionality.

Typical scenarios include:

  • Sending a user prompt along with an optional system prompt to guide the AI's behavior.
  • Including an image URL to provide additional context to the model.
  • Adjusting parameters like temperature and penalties to control response creativity and style.
  • Using pseudo-stream mode to handle models that only support streaming responses by consuming the stream internally and returning the final answer.

Example: A user can input a question or message, optionally specify a system prompt to set the assistant’s tone, and receive a coherent AI-generated reply suitable for chatbots or automated help desks.

Properties

Name Meaning
Model Name or ID Select the AI model to use from a dynamically loaded list or specify a model ID via expression.
System Prompt A system-level message to define the assistant's behavior or persona (e.g., "You are a helpful assistant...").
Message The main user message or query to send to the chat model.
Image URL Optional URL of an image (http/https link or base64 data URL) to provide visual context alongside the text message.
Pseudo-Stream Mode Enable this mode for models that only support streaming responses; the node will consume the stream internally and return the complete final answer instead of partial streamed data.
Temperature Sampling temperature controlling randomness in the output; higher values produce more creative responses.
Additional Fields Collection of optional parameters:
- Frequency Penalty: Penalizes frequent tokens (-2.0 to 2.0).
- Max Tokens: Maximum tokens to generate in the response.
- Presence Penalty: Penalizes new tokens (-2.0 to 2.0).
- Top P: Nucleus sampling parameter alternative to temperature.

Output

The node outputs JSON data containing the AI-generated response:

{
  "response": "string" // The text content generated by the AI model in reply to the input message.
}

If pseudo-stream mode is enabled and the model streams partial results, the node aggregates these into a single final response string before output.

Additionally, if the API returns reasoning content during streaming, it is included as:

{
  "response": "string",
  "reasoning": "string" // Optional additional explanation or reasoning content from the AI.
}

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the 302.AI service.
  • The node makes HTTP requests to the 302.AI API endpoints:
    • GET https://api.302.ai/v1/models?llm=1 to load available models.
    • POST https://api.302.ai/v1/chat/completions to send chat messages and receive completions.
  • Proper network access to the 302.AI API is necessary.
  • No other external dependencies are required.

Troubleshooting

  • Missing or invalid API key: The node throws an error if no valid API key is provided. Ensure the API key credential is configured correctly.
  • Unsupported operation: If an operation other than "chat" is specified, the node will error out. Only the "Chat" operation is supported.
  • Invalid response format: If the API response does not contain expected fields, an error is raised. This may indicate API changes or connectivity issues.
  • No models found: When loading models, if none are returned, verify your API key permissions and network connectivity.
  • Pseudo-stream mode issues: If enabled but the model does not support streaming, the node may fail or behave unexpectedly. Use this option only with compatible models.
  • Rate limits or API errors: Standard API errors from 302.AI (e.g., rate limiting, invalid parameters) will be surfaced as node errors. Review API usage and parameters accordingly.

Links and References

This summary is based solely on static analysis of the provided source code and property definitions.

Discussion