Skip to main content

A CLI tool for describing tasks using LLM tools

Project description

TASK-AI: CLI for describing Stonebranch task definitions

Overview

Task AI is a powerful command-line tool designed to process Stonebranch Task JSON data, offering features like anonymization, parsing, and description generation. It's built with flexibility and ease of use in mind, making it ideal for various data analysis and manipulation tasks.

Key Features:

  • Anonymization: Securely anonymize sensitive data within your JSON files using configurable rules.
  • Parsing: Process and structure your JSON data according to your specific needs.
  • Description Generation: Generate clear and concise descriptions based on the processed JSON data.
  • Configuration: Customize Task AI's behavior through a simple YAML configuration file.
  • Logging: Track the tool's progress and debug issues with detailed logging capabilities.
  • Command-Line Interface: Enjoy a user-friendly command-line interface for easy interaction.

Getting Started:

Installation: Install Task AI using pip:

pip install task-ai

Configuration: Create a configuration file (e.g., ~/.uac/task_ai.yml) to define your anonymization rules, parsing options, and other settings. Usage: Run Task AI from your terminal, specifying the input JSON file and any desired options.

Sample Config

template_path: task_ai/templates
prompt_example_path: task_ai/prompts/examples
llm:
  provider: "ollama"
  api_base: "http://localhost:11434"
  model: "llama3:latest"
  # For OpenAI use the following configuration
  # provider: "openai"
  # api_key: "sk-xxxxx
  # model: "gpt-4o"
  # temperature: 0.2
  # max_tokens: 1024
  # base_prompt: >
  # If there are notes just summarize the content of the notes. Do not include any notes in the output.
anonymization:
  fields:
    - agent
    - name
    - script
    - sysId
    - agentVar
    - command
    - parameters
    - summary
    - agent_cluster
    - broadcastCluster
    - credentials
    - runtimeDir
processing:
  exclude:
    - sysId
    - version
    - firstRun
    - lastRun
    - exportReleaseLevel
    - lastRunTimeDisplay
    - minRunTimeDisplay
    - maxRunTimeDisplay
    - avgRunTimeDisplay
    - notes
  include:
    - type

Example:

task-ai -i input.json -c config.yml -s

This command will process input.json using the settings in config.yml, anonymize the data, and display the anonymized JSON output and the description of the task.

You can use this tool combined with UAC-CLI tool like this.

uac task get task_name="Linux Sleep 10" | task-ai -s

Output

{
    "type": "taskUnix",
    "agent": "{agent}",
    "command": "{command}",
    "name": "{name}"
}
Unix task running on 'AGENT1' agent with name 'Linux Sleep 10' that will run a command as 'sleep 10'.

Security

Your data will be anonymized using the provided rules. Sensitive data will not be sent to LLM API. Sensitive data is defined by the fields in the config file.

The sensitive data will be replaced with a string of {field_name}, for example: Agent will be replaced with {agent}. Once the description returned from LLM API, it will be replaced back to its original value.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

task-ai-0.0.3.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

task_ai-0.0.3-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file task-ai-0.0.3.tar.gz.

File metadata

  • Download URL: task-ai-0.0.3.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for task-ai-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0e31ac624bf1bc6339181f03cb946a1b196c10014694e043cf3d6a24ff49162f
MD5 7eb77df6b42cf4afac9a1fc34f38953c
BLAKE2b-256 0a10682b793372b8f840d5745874ba7db67fc713ab363f9d7238a37b23f1ec5a

See more details on using hashes here.

File details

Details for the file task_ai-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: task_ai-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for task_ai-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b7346b4ac4433abfbfb049dff79dfd57390c7932aa45a1e6eacb240bd67c1f11
MD5 a276dcac6b9a04034170347be07d6cee
BLAKE2b-256 2f4cfca954284327d62cfdbd413dda6e83f4596883d8184cf9df3b76aff45c3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page