Skip to main content

Official Python SDK for Meowdel AI API

Project description

Meowdel Python SDK

Official Python client for the Meowdel AI API.

Installation

pip install meowdel

Or install from source:

git clone https://github.com/afterdarksystems/meowdel-python
cd meowdel-python
pip install -e .

Quick Start

from meowdel import MeowdelClient

# Initialize client
client = MeowdelClient(api_key="mdl_your_key_here")

# Simple chat
response = client.chat("How do I fix this TypeScript error?")
print(response.message)

# Chat with personality and Brain context
response = client.chat(
    message="Explain quantum computing",
    personality="professor",
    use_brain_context=True
)
print(response.message)

# Combine multiple operations
response = client.combine(
    query="What is machine learning?",
    operations=["search", "explain", "visualize"],
    primary_personality="professor"
)
print(response.result)

Configuration

API Key

Set your API key via environment variable:

export MEOWDEL_API_KEY="mdl_your_key_here"

Or pass it directly:

client = MeowdelClient(api_key="mdl_your_key_here")

Get your API key from: https://meowdel.ai/profile

Custom Base URL

client = MeowdelClient(
    api_key="mdl_your_key_here",
    base_url="https://api.meowdel.ai"  # Custom endpoint
)

API Reference

Chat

response = client.chat(
    message="Your question here",
    personality="mittens",  # mittens, luna, professor, ninja, zoomies
    use_brain_context=False,
    conversation_history=[
        {"role": "user", "content": "Previous message"},
        {"role": "assistant", "content": "Previous response"}
    ]
)

print(response.message)
print(response.personality)
print(response.tokens_used)

Combine Operations

response = client.combine(
    query="What is recursion?",
    operations=["search", "explain", "code_example"],
    primary_personality="professor",
    secondary_personality="mittens"
)

print(response.result)
print(response.operations)

Context Manager

with MeowdelClient(api_key="mdl_your_key") as client:
    response = client.chat("Hello!")
    print(response.message)
# Session automatically closed

Available Personalities

  • mittens - Playful and friendly
  • luna - Elegant and sophisticated
  • professor - Scholarly and analytical
  • ninja - Stealthy and mysterious
  • zoomies - Hyper and energetic
  • And more!

Error Handling

from meowdel import MeowdelClient, AuthenticationError, RateLimitError, APIError

try:
    client = MeowdelClient(api_key="mdl_invalid")
    response = client.chat("Hello")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError:
    print("Rate limit exceeded")
except APIError as e:
    print(f"API error: {e}")

Examples

Chat with conversation history

from meowdel import MeowdelClient, Message

client = MeowdelClient()

history = [
    Message(role="user", content="What is Python?"),
    Message(role="assistant", content="Python is a programming language..."),
]

response = client.chat(
    message="Can you give me an example?",
    conversation_history=history
)

Using Brain context

# Query with knowledge graph context
response = client.chat(
    message="What did we discuss about Docker?",
    use_brain_context=True,
    personality="professor"
)

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black meowdel/

# Type checking
mypy meowdel/

License

MIT

Support

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

meowdel-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

meowdel-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file meowdel-0.1.0.tar.gz.

File metadata

  • Download URL: meowdel-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for meowdel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 64d9c586e15d7a6483f156c0f869a6ff123826e77129b693b0960330d275e67a
MD5 7c60a206454c2749790d44f11f71351d
BLAKE2b-256 bb1e2cf2dce438892a595949f4a3886a696271302de6b2c9308e48c12127d4f8

See more details on using hashes here.

File details

Details for the file meowdel-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: meowdel-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for meowdel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8df109f9a9680f297b6a6bc998d5841eca55542c02a3beb2df65409b943c5a0
MD5 dae2af5319e346db61ecbb9ea557b5ba
BLAKE2b-256 f70905e35460a7e2ef341c4926cbf23389a15e5f86f8adb9a23a38367665b95e

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