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",
    persona_api_key=os.getenv("STEER_API_KEY"),
)

persona_config = {
    "ages": ["young adult"],
    "genders": ["woman"],
    "occupations": ["teacher"],
    "intents": ["Resolve billing issue"],
    "traits": {"impatience": [0, 2, 4]},
}
results = client.simulate(persona_config, k=1, num_exchanges=2)
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.6.tar.gz (22.5 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.6-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: collinear-1.0.6.tar.gz
  • Upload date:
  • Size: 22.5 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.6.tar.gz
Algorithm Hash digest
SHA256 bc403c8f5e1bd58507bcc930c3db8e31f7882b12e4fc0486e5be2e352e2aec28
MD5 ab58c3b067bff6ae164b40ea4f67293d
BLAKE2b-256 149b599e9419179fa4ac8bc9c538874fce515614bd83aaaef61406d27a614c2c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: collinear-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 20.4 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7367e8059f6aaee9a24df4579e38b7337014eab31ac380fcd152d1b47c79f67e
MD5 77b8d856f7823d2456eb46681be3d6d0
BLAKE2b-256 a2c1ce6e65682d55e97a3bdd9a8ffb29f8b7ec3f0e865ac7b773381c1d42b956

See more details on using hashes here.

Provenance

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