Skip to main content

An app for interacting with AI services

Project description

Odin CLI

Odin is a command-line interface (CLI) application designed to interact with various AI services, including OpenAI and Amazon Bedrock. It emphasizes simplicity, modularity, and extensibility.

Disclaimer

Odin is in active development. Features and functionalities may change, and the tool is not yet fully stable. Users should be aware of potential risks in its use.

The main purpose of this project is to experiment with various workflows for interacting with AI services. Because of the explorative nature, the tool it is not stable.

Table of Contents

Features

  • Single Prompt Interactions: Provide single prompts to AI services via text, URL, file path, or S3 path.
  • Interactive Chats: Engage and persist interactive chats with AI services.
  • Persistent Conversations: Save and resume chat histories.
  • Modular Architecture: Integration with more AI services is straightforward.

Installation

To install Odin:

pip install --user odin-cli

Prerequisites

  • Python 3.x
  • pip (Python package manager)
  • Git

Usage

Basic Commands

After installation, use the ask binary to interact with AI services.

  • Query Bedrock:
    odin ask bedrock "Tell me a joke"
    
  • Query OpenAI:
    odin ask openai "Tell me a fact"
    

Detailed Usage Examples

Interacting with Bedrock

  • Simple Prompt:
    odin ask bedrock "Tell me a joke"
    
  • File Input:
    odin ask bedrock /path/to/my_query.txt
    
  • URL Input:
    odin ask bedrock https://example.com/my_query.txt
    
  • Interactive Chat:
    odin ask bedrock --chat my_chat_history.json
    

Interacting with OpenAI

  • Simple Query:
    odin ask openai "Tell me a fact"
    
  • Interactive Chat:
    odin ask openai --chat session_history.json
    

Passing Variables to Prompts

Odin CLI allows dynamic content generation in prompts using variables.

Usage of Variables in Prompts

  • Single Variable:
    odin ask openai "Translate '{text}' to French" text="Hello, world"
    
  • Multiple Variables:
    odin ask bedrock "What is the weather like in {city} on {date}?" city="Paris" date="2023-07-16"
    

Formatting and Constraints

  • Enclose variables in {}.
  • Replace each variable with its value using variable_name="value".
  • Variables can be repeated in a prompt.
  • Avoid spaces in variable assignments.

Command Arguments and Options

Argument/Option Description Example
prompt Text, file path, URL, or S3 path for the prompt. odin ask openai "Translate '{text}' to French" text="Hello"
--model Specifies the AI model. odin ask openai --model="gpt-4" "What is AI?"
--chat Initiates interactive chat and specifies history file. odin ask bedrock --chat chat_history.json
/path/to/file Path to a text file with the prompt. odin ask openai /path/to/fact_request.txt
s3://bucket/file S3 path to a file with the prompt. odin ask openai s3://mybucket/fact_request.txt
https://url URL to a text file with the prompt. odin ask openai https://example.com/fact_request.txt

License

Odin is licensed under the MIT License. See the LICENSE file for details.

Support

For support, questions, or feedback, open an issue.

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

odin_cli-0.0.16.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

odin_cli-0.0.16-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

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