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",
    steer_api_key=os.environ.get("STEER_API_KEY", "demo-001"),
)

steer_config = {
    "ages": ["young adult"],
    "genders": ["woman"],
    "occupations": ["teacher"],
    "intents": ["Resolve billing issue"],
    "traits": {"impatience": [0.0, 2.5, 4.0]},
}

results = client.simulate(
    steer_config,
    k=1,
    num_exchanges=2,
    steer_temperature=0.7,
    steer_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.9.tar.gz (32.1 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.9-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: collinear-1.0.9.tar.gz
  • Upload date:
  • Size: 32.1 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.9.tar.gz
Algorithm Hash digest
SHA256 80024691b3425722cbb1b33841e12554eeddd25667700358bbc096016281caa2
MD5 d96d9036b9a859a4100a8909b776cdc6
BLAKE2b-256 3e1a50b4398a49a5277cf3f2223602502aa264f84e2dcf46d61b2295596b7dad

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: collinear-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 24.9 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f98da178ced2bfdd8411061e47e11992776102d15839929c93734d47f6c5ccfd
MD5 3e59f51615136c51ab1d71f1e5633eba
BLAKE2b-256 7317d592ce655a6e2ad9f81d80a221253b5a401fd5b0fb3ffcf52675e0eb82b2

See more details on using hashes here.

Provenance

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