Skip to main content

Collinear public Python library

Project description

Collinear Python SDK

Persona‑driven chat simulation for OpenAI‑compatible endpoints.

Requires Python 3.10+.

Install (uv)

uv venv && source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv add collinear
uv sync

Quickstart

import os
from collinear.client import Client

client = Client(
    assistant_model_url="https://api.openai.com/v1",
    assistant_model_api_key=os.environ["OPENAI_API_KEY"],
    assistant_model_name="gpt-4o-mini",
    collinear_api_key=os.environ.get("COLLINEAR_API_KEY"),
)

traitmix_config = {
    "ages": ["25-34"],
    "genders": ["woman"],
    "occupations": ["Employed"],
    "intents": ["Resolve billing issue"],
    "traits": {"impatience": ["low", "medium", "high"]},
    "locations": ["United States"],
    "languages": ["English"],
    "tasks": ["telecom support"],
}

results = client.simulate(
    traitmix_config,
    k=1,
    num_exchanges=2,
    traitmix_temperature=0.7,
    traitmix_max_tokens=256,
)

assessment = client.assess(results)
for row in assessment.evaluation_result:
    for score in row.values():
        print("score=", score.score, "rationale=", score.rationale)

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

collinear-1.0.24.tar.gz (69.9 kB view details)

Uploaded Source

Built Distribution

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

collinear-1.0.24-py3-none-any.whl (46.0 kB view details)

Uploaded Python 3

File details

Details for the file collinear-1.0.24.tar.gz.

File metadata

  • Download URL: collinear-1.0.24.tar.gz
  • Upload date:
  • Size: 69.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for collinear-1.0.24.tar.gz
Algorithm Hash digest
SHA256 133be5dad63b9cbb5b4163d127b80f5e2038f904272bb8adbce4cda71a30cca2
MD5 e1098d7398277c06d24ba273c8b4231c
BLAKE2b-256 8498a8302e29641e6ebdea7cc50ee59bf0986f6dba1902c9c36fe27360bb9180

See more details on using hashes here.

Provenance

The following attestation bundles were made for collinear-1.0.24.tar.gz:

Publisher: release.yml on collinear-ai/collinear-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file collinear-1.0.24-py3-none-any.whl.

File metadata

  • Download URL: collinear-1.0.24-py3-none-any.whl
  • Upload date:
  • Size: 46.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for collinear-1.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 851964f8dea0b140ed19fbf7b3971f2c611f27e6c37f1254af9815f109a4a8e8
MD5 4fbb2248fab0803852e54aed371d1f54
BLAKE2b-256 9421fde14d8cb71361ce98a7c4bd9e52b74ad049330beb8e5ec40bfc54c0a965

See more details on using hashes here.

Provenance

The following attestation bundles were made for collinear-1.0.24-py3-none-any.whl:

Publisher: release.yml on collinear-ai/collinear-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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