Unlock Data Insights with the Pandalyst Cognitive Actions

22 Apr 2025
Unlock Data Insights with the Pandalyst Cognitive Actions

In the world of data science, the ability to analyze and derive insights from complex datasets is paramount. The Pandalyst Cognitive Actions, part of the tomasmcm/pandalyst-7b-v1.2 specification, leverage a powerful large language model designed to perform advanced data analysis using the popular pandas library. These pre-built actions enable developers to efficiently process data tables and extract meaningful insights, often with greater accuracy and speed than traditional methods.

Prerequisites

To get started with Pandalyst Cognitive Actions, you will need the following:

  • An API key for the Cognitive Actions platform, which allows you to authenticate your requests.
  • Familiarity with JSON formatting, as the input and output will be structured in this format.

Authentication typically involves passing your API key in the request headers, ensuring secure access to the Cognitive Actions functionality.

Cognitive Actions Overview

Analyze Data with Pandalyst

The Analyze Data with Pandalyst action allows you to harness the capabilities of the Pandalyst model for detailed data analysis. This action excels at interpreting complex data sets and providing insightful responses based on the supplied prompt.

Input

The input schema for this action requires the following fields:

  • prompt (required): The primary text input that describes the data and the analysis task.
  • maxTokens (optional): Defines the maximum number of tokens for the response (default is 128).
  • temperature (optional): Controls the randomness of the output (default is 0.8).
  • topK (optional): Limits the number of top tokens to consider for sampling (default is -1).
  • topP (optional): Sets the cumulative probability threshold for top tokens (default is 0.95).
  • presencePenalty (optional): Penalizes repeated tokens (default is 0).
  • frequencyPenalty (optional): Penalizes frequent tokens (default is 0).
  • stop (optional): Specifies a string at which to stop generation.

Here’s an example of the input JSON payload you might use:

{
  "topK": -1,
  "topP": 0.95,
  "prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nDataframe Name: Career summary, with 43 rows and 9 columns.\nDescription: This is a table about Gabriel Furlán: Career summary\nColumns: Season, Series, Team, Races, Wins, Poles, Podiums, Points, Position\nQuestion: \nCan we analyze the correlation between the number of races Gabriel Furlán participated in each season and the number of wins he achieved in the same season?\n\n### Response:\n",
  "maxTokens": 512,
  "temperature": 0.8,
  "presencePenalty": 0,
  "frequencyPenalty": 0
}

Output

The output from this action typically includes a detailed response that outlines the analysis based on the input prompt. The response might include steps for data manipulation, calculations, and interpretations. Here's an example of the output you might receive:

This task seems to be a simple analysis task which can be performed using the pandas library. ...

Conceptual Usage Example (Python)

Here’s how a developer might call the Pandalyst action using a hypothetical endpoint:

import requests
import json

# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute" # Hypothetical endpoint

action_id = "8d9e05fe-7f99-48ec-9864-4dc2e6098f54" # Action ID for Analyze Data with Pandalyst

# Construct the input payload based on the action's requirements
payload = {
    "topK": -1,
    "topP": 0.95,
    "prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nDataframe Name: Career summary, with 43 rows and 9 columns.\nDescription: This is a table about Gabriel Furlán: Career summary\nColumns: Season, Series, Team, Races, Wins, Poles, Podiums, Points, Position\nQuestion: \nCan we analyze the correlation between the number of races Gabriel Furlán participated in each season and the number of wins he achieved in the same season?\n\n### Response:\n",
    "maxTokens": 512,
    "temperature": 0.8,
    "presencePenalty": 0,
    "frequencyPenalty": 0
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json"
}

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json={"action_id": action_id, "inputs": payload} # Hypothetical structure
    )
    response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully:")
    print(json.dumps(result, indent=2))

except requests.exceptions.RequestException as e:
    print(f"Error executing action {action_id}: {e}")
    if e.response is not None:
        print(f"Response status: {e.response.status_code}")
        try:
            print(f"Response body: {e.response.json()}")
        except json.JSONDecodeError:
            print(f"Response body: {e.response.text}")

In this example, the action ID and input payload are appropriately set, allowing for seamless integration with the Pandalyst action. Please note that the endpoint URL and request structure provided are illustrative.

Conclusion

The Pandalyst Cognitive Actions provide developers with a robust toolset for advanced data analysis, enabling quick insights from complex datasets. By integrating these actions into your applications, you can streamline your data processing tasks and enhance decision-making capabilities. Consider exploring additional use cases or combining multiple actions to unlock even greater analytical potential!