DoCoreAI Documentation

Welcome to the official documentation for DoCoreAI, your dynamic AI prompt optimization engine. Follow the steps below to install, configure, and use DoCoreAI effectively.

Introduction

DoCoreAI dynamically optimizes prompt performance for large language models by adjusting parameters like temperature based on context and intent.

Key Features

  • Dynamic temperature and context profiling
  • Supports OpenAI and Groq APIs
  • Token usage and cost estimation

Use Cases

  • Prompt engineers testing various model behaviors
  • Startups optimizing LLM usage costs
  • Advanced developers running multi-model systems

Getting Started

1️⃣ Installation

pip install docoreai

2️⃣ Environment Setup

# .env file
OPENAI_API_KEY="your-openai-api-key"
GROQ_API_KEY="your-groq-api-key"
MODEL_PROVIDER="openai"  # Choose 'openai' or 'groq'
MODEL_NAME="gpt-3.5-turbo"  # Options: gpt-3.5-turbo, gemma2-9b-it, etc.

Quick Start Guide

3️⃣ Example Python Code

import os
from dotenv import load_dotenv
from docore_ai import intelligence_profiler

load_dotenv()

response = intelligence_profiler(
    "What is one good way to start python coding for an experienced programmer",
    "AI Developer",
    os.getenv("MODEL_PROVIDER"),
    os.getenv("MODEL_NAME")
)

print(response)

4️⃣ Run Your File

python your_script.py

Advanced Usage

Function Reference

def intelligence_profiler(
    user_content: str,
    role: str,
    model_provider: str = MODEL_PROVIDER,
    model_name: str = MODEL_NAME,
    show_token_usage: Optional[bool] = False,
    estimated_cost: Optional[bool] = True
) -> dict:

📌 Parameters

  • user_content: The user's prompt or input. - [mandatory]
  • role: The AI assistant's persona (e.g. "AI Developer"). - [mandatory]
  • model_provider: Select between "openai" or "groq".
  • model_name: Model name like "gpt-3.5-turbo" or "gemma2-9b-it".
  • show_token_usage: Enables token usage stats (default: False).
  • estimated_cost: Shows estimated cost (default: True).

FAQs & Troubleshooting

  • Q: Why is my API key not working?
    A: Ensure the `.env` file is correctly placed and your keys are valid.
  • Q: Can I switch models dynamically?
    A: Yes, just change `MODEL_PROVIDER` and `MODEL_NAME` in your code or `.env`.

📄 License & Contributing

The DoCoreAI SaaS platform and the official docoreai PyPI package are licensed under a commercial proprietary license. These versions include premium features such as performance telemetry, reporting, and SaaS integration not available in the open-source edition.

However, a core version of DoCoreAI is available under the MIT License at: https://github.com/SajiJohnMiranda/DoCoreAI. This open-source version is suitable for local experimentation, and community contributions are welcome.