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"),
)

steer_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(
    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.20.tar.gz (37.6 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.20-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: collinear-1.0.20.tar.gz
  • Upload date:
  • Size: 37.6 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.20.tar.gz
Algorithm Hash digest
SHA256 7206a600776cb1da39f4946782b341cb08c47172283b92b6627f62f655abfc93
MD5 3f7e20542f8a5c6cd274c530ab938918
BLAKE2b-256 3945504c8e6bf8c25816b278d370846a188224990eb6597133e95822d8a92f6c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: collinear-1.0.20-py3-none-any.whl
  • Upload date:
  • Size: 29.5 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.20-py3-none-any.whl
Algorithm Hash digest
SHA256 04f3762da06c46d6fcd7c06cb9994cba5aef66e1b2063787bec67b8ba971f218
MD5 202e8130f6aed1b1670c3a6cd3d85833
BLAKE2b-256 305660b1aec4a4e6f9cecb781e2d74f00dece43b062e24ca19e3644396a060ed

See more details on using hashes here.

Provenance

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