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_config = {
    "ages": ["young adult"],
    "genders": ["woman"],
    "occupations": ["teacher"],
    "intents": ["Resolve billing issue"],
    "traits": {"patience": [0, 2, 4]},
}

results = client.simulate(persona_config, k=1, num_exchanges=2)

for sim in results:
    for m in sim.conv_prefix:
        print(m["role"], ":", m["content"])
    print("assistant:", sim.response)

Project details


Release history Release notifications | RSS feed

This version

1.0.2

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.2.tar.gz (15.8 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.2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: collinear-1.0.2.tar.gz
  • Upload date:
  • Size: 15.8 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.2.tar.gz
Algorithm Hash digest
SHA256 df8e580c05424e66ca33acfcb500663d9a639287d2231292b898e57a913fe266
MD5 4ec455bb074d67ef634179c0ab4897ad
BLAKE2b-256 5690f67fb3a99bb7f9e9a9e77f0bad5bf33b19b7fe93340d0d3b3868d7a4fb44

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: collinear-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8c865b710028ae5f002e1d4e712e532ebf14ed3c2a7f93ef733885231214a152
MD5 2e4b62ee04e31b9ddb6e013ec66a704b
BLAKE2b-256 98342d82c1799bf9e342ad50aead78d0d15a229faf27a8ecf0eebad69c199fb8

See more details on using hashes here.

Provenance

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