The Model step provides a structured interface for interacting with AI models through messages. Each message consists of a role and content, allowing you to create sophisticated AI interactions with proper context and flow.

Message Structure

Each message contains two essential elements:

  1. Role: Determines the message sender (system, user, or assistant)
  2. Content: The actual message content (text, images, or both)

Roles

  1. System
    • Sets context and behavior instructions
    • Guides the AI model’s responses
  2. User
    • Contains input from the user
    • Can include text and images
  3. Assistant
    • Represents AI model responses
    • Used for maintaining conversation context

Messages

Learn how to structure messages for effective communication with AI models.

Creating Messages

  1. Click the Add Message button
  2. System will auto-select appropriate role
  3. (Optional) Change role via dropdown menu
  4. Enter message content

Basic Example

A simple demonstration of system and user messages without conversation context.

messages.json
[
  {
    "role": "system",
    "content": "You are a customer service expert focused on analyzing product feedback."
  },
  {
    "role": "user",
    "content": "Please analyze this customer feedback: 'The software interface is intuitive and easy to navigate, but the export feature is slow.'"
  }
]

Contextual Message Example

A more advanced example showing how conversation context is maintained through multiple messages between user and assistant. This helps create more natural, contextual interactions.

messages.json
[
  {
    "role": "user",
    "content": "Can you help me summarize this product review?"
  },
  {
    "role": "assistant",
    "content": "I'd be happy to help summarize product reviews. Please share the review you'd like me to analyze."
  },
  {
    "role": "user",
    "content": "The new phone case is great quality but a bit expensive."
  }
]

Multi-Content User Messages

Users can combine text and images in a single message:

messages.json
[
  {
    "role": "system",
    "content": "You are a customer service expert focused on analyzing product feedback."
  },
  {
    "role": "user",
    "content": [
      {
        "type": "text",
        "text": "Here's a customer review with a product photo:\n\nThe headphones have excellent sound quality and the blue color looks great in person."
      },
      {
        "type": "image",
        "image": "https://example.com/headphones-photo.jpg"
      }
    ]
  }
]

Deleting Messages

  • Click the delete icon in the message options header to remove a message

This structure provides a clear, organized way to interact with AI models while maintaining context and enabling sophisticated conversations.

JSON Editor

The JSON editor provides a convenient way to directly edit the raw JSON messages that will be sent to the model.

To open the JSON editor, click the curly braces icon in the model step tabs. You can switch between the visual editor and JSON editor by clicking either the color palette icon or the curly braces icon in the tabs. Both editors will stay in sync, so you can switch back and forth as needed.

Options

Configure how the model behaves and processes your inputs with these key settings. The options allow you to fine-tune the model’s responses to better match your specific use case.

Temperature

Controls the randomness and creativity in the model’s responses by setting a value between 0.0 and 1.0:

  • 0.0-0.3: Best for factual and analytical tasks requiring high precision and consistency
  • 0.3-0.7: Ideal for balanced tasks needing both creativity and accuracy
  • 0.7-1.0: Optimal for highly creative tasks like brainstorming and storytelling

Choose a temperature that matches your use case - lower for facts, higher for creativity.

Response

Configure how you want the model to structure its response. There are two options available:

Text

The model will respond in natural language format. This is the default behavior and ideal for general financial analysis and advice.

[
  {
    role: 'user',
    content: 'What are 3 key factors to consider before investing in stocks?',
  },
];

// The model will respond naturally like:
// "Here are 3 key factors to consider before investing in stocks:
// 1. Your risk tolerance and investment timeline
// 2. The company's financial health and performance
// 3. Market conditions and industry trends"

JSON

The model will structure its response in JSON format. Simply provide the desired key names or an example output in your prompt.

Specifying the JSON Key Names:

[
  {
    "role": "system",
    "content": "Respond in JSON format with the following keys: stockSymbol (string), currentPrice (number), riskLevel (low, medium, high), and keyMetrics (array of strings)."
  },
  {
    "role": "user",
    "content": "Analyze Apple stock"
  }
]

Specifying the JSON Example Output:

[
  {
    "role": "system",
    "content": "Example output:\n{\n  \"portfolioType\": \"Conservative\",\n  \"allocation\": {\n    \"stocks\": 40,\n    \"bonds\": 40,\n    \"cash\": 20\n  },\n  \"monthlyReturn\": 2.5\n}"
  },
  {
    "role": "user",
    "content": "Generate a balanced investment portfolio"
  }
]

The model will automatically format its response to match the provided schema or example, without needing explicit instructions to do so.

Models

Cortex offers four distinct categories of models to suit different needs:

  • Base Models: Production-ready, stable models that are widely used (e.g., GPT-4o). These models automatically update to the latest version within their model family.
  • Efficient Models: Optimized models that prioritize speed and cost-effectiveness (e.g., GPT-4o-mini).
  • Versioned Models: Specific model versions with fixed release dates for consistent behavior (e.g., GPT-4o-2024-08-06).
  • Experimental Models: Models in beta testing or experimental phase.
CategoryAvailable Models
Base ModelsGPT-4o, Claude Sonnet 3.5, Gemini 1.5 Pro
Efficient ModelsGPT-4o-mini, o1-mini, Claude 3.5 Haiku, Gemini 1.5 Flash, Llama 3.2 11b Vision
Versioned ModelsGPT-4o (08/06/2024), GPT-4o (11/20/2024), Claude 3.5 Sonnet (06/20/2024), Claude 3.5 Sonnet (10/22/2024), Gemini 1.5 Pro (09/24/2024)
Experimentalo1-preview, Grok 2 Vision

Model Selection

To choose a model, use the model selector dropdown in the model step header. Models are organized by category for easy navigation and selection.