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.21.tar.gz (39.0 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.21-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: collinear-1.0.21.tar.gz
  • Upload date:
  • Size: 39.0 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.21.tar.gz
Algorithm Hash digest
SHA256 75c31aa0a89a516122735e388d1d71d8f9527f1581f5ab59f31f1b5f8f29ad0a
MD5 dbd330283c01b4a144e6ff871a28d264
BLAKE2b-256 f9e94d89855c1746737df7fa3c4daf33ec54da1825d5e604e75961bb8a5e826b

See more details on using hashes here.

Provenance

The following attestation bundles were made for collinear-1.0.21.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.21-py3-none-any.whl.

File metadata

  • Download URL: collinear-1.0.21-py3-none-any.whl
  • Upload date:
  • Size: 29.6 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.21-py3-none-any.whl
Algorithm Hash digest
SHA256 4e665a18f6c047bc5b9be35a0662066b6111a8e0c35db15a45de82d8d3967b8b
MD5 70762fde02a60f431d61655ee8e06388
BLAKE2b-256 772e1d39ecc883e1ac5b8a1b0dd95fa709e072c21a41e855b78b37e204c0437f

See more details on using hashes here.

Provenance

The following attestation bundles were made for collinear-1.0.21-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