Skip to main content

Official Python SDK for Freddy AI Assistant API

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

freddy-python

The official Python SDK for the Freddy API.

Installation

pip install aitronos-freddy

Usage

Prerequisites

Before using the SDK, you need to have:

  • A Freddy API Key
  • Your Organization ID

You can get these from the Freddy Hub.

Environment Variables

It's recommended to set your credentials as environment variables. You can create a .env file in your project root:

FREDDY_API_KEY="your-api-key-here"
FREDDY_ORG_ID="your-organization-id"

The client will automatically load these variables.

Synchronous Client

Here's a basic example of how to use the synchronous client:

from freddy import FreddyClient

# The client automatically picks up FREDDY_API_KEY from environment variables.
# You can also pass it directly: FreddyClient(api_key="your-key")
with FreddyClient() as client:
    response = client.responses.create(
        model="gpt-4.1",
        inputs=[{"role": "user", "texts": [{"text": "Hello, world!"}]}],
        organization_id="your-org-id" # Can be set via FREDDY_ORG_ID env var
    )
    print(response.output[0].content[0].text)

Asynchronous Client

The SDK also provides an asynchronous client for use with asyncio.

import asyncio
from freddy import AsyncFreddyClient

async def main():
    async with AsyncFreddyClient() as client:
        response = await client.responses.create(
            model="gpt-4.1",
            inputs=[{"role": "user", "texts": [{"text": "Hello, async world!"}]}],
            organization_id="your-org-id"
        )
        print(response.output[0].content[0].text)

if __name__ == "__main__":
    asyncio.run(main())

Development

Setup

  1. Clone the repository.

  2. Install dependencies using Poetry:

    poetry install
    

Running Tests

The SDK uses pytest.

Unit Tests

These tests don't require any API credentials and are very fast.

poetry run pytest

Integration Tests

These tests run against the actual Freddy API and require credentials. Make sure your .env file is set up as described in the Usage section.

# Run integration tests against the staging environment
poetry run pytest tests/integration/ --integration --env=staging

You can also run against local or production environments by changing the --env flag.

To see test coverage:

poetry run pytest --cov=freddy

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

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

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

aitronos_freddy-0.1.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

aitronos_freddy-0.1.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file aitronos_freddy-0.1.1.tar.gz.

File metadata

  • Download URL: aitronos_freddy-0.1.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for aitronos_freddy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 92e0919e3db0f176b559ebb2a298732147d7801cfe35280a32909f47f029196d
MD5 d7e7a38a4bc405b7d9511108d874228f
BLAKE2b-256 82649387760a89fbc8a9f592a9986bda392a45b945d9e0d132b3064265620ac4

See more details on using hashes here.

File details

Details for the file aitronos_freddy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aitronos_freddy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for aitronos_freddy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 353514f2aa3ad9cc282a8f10ef88be9485f9f436d6b35829d518eef1a0b3aa68
MD5 bb31c210280d9245753b84b8dd8c01d0
BLAKE2b-256 fd83e0af59c5e160843ea8f95b161c5a831152900fa4cfdf251f849eaed125d1

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