Skip to main content

A conversational prompting and programming language

Project description

Convo-Lang Python Wrapper (v0.6.2)

PyPI Downloads

A Python wrapper around the Convo-Lang CLI that lets you build conversations in Python and execute them via the official Convo-Lang engine.

Status: 0.6.2 – basic conversation building, runtime variables support, and single-shot completion via the CLI.


Features

  • Minimal, Pythonic API to build conversations (system, user, assistant)
  • One-line complete() to run via Convo-Lang CLI, with optional runtime variables via complete(variables={...})
  • Simple config with env passthrough (e.g., OPENAI_API_KEY) and defaultModel
  • Zero server code required — uses the official Convo-Lang CLI under the hood

Installation

1. Install Node.js and npm

The wrapper depends on the Convo-Lang CLI, which requires Node.js.
Download and install the latest LTS version of Node.js (includes npm):

Verify installation:

node -v
npm -v

2. Install the Convo-Lang CLI

npm i -g @convo-lang/convo-lang-cli

This makes the convo binary available in your PATH.

3. Install the Python wrapper

pip install convo-lang

Quick Start

from convo_lang import Conversation

OPENAI_API_KEY = "sk-proj-EMA"
defaultModel = "gpt-5"
convo = Conversation(
    config={
        "env": {"OPENAI_API_KEY": OPENAI_API_KEY},
        "defaultModel": defaultModel,
    }
)
convo.add_system_message("You are a home automation assistant.")
convo.add_user_message("It's time for bed, can you turn off the lights")
answer = convo.complete()
print(answer)

Passing Variables to .convo

You can pass variables to the Convo-Lang runtime using the variables argument of complete(). These variables can be referenced inside your .convo script.

from convo_lang import Conversation

convo = Conversation(
    config={
        "env": {"OPENAI_API_KEY": OPENAI_API_KEY},
        "defaultModel": defaultModel,
    }
)

convo.add_convo_text(convo_text)

answer = convo.complete(variables={"isNewVisitor": True})
print(answer)

Variables are forwarded to the Convo-Lang CLI via --vars and support booleans, numbers, and strings.


Requirements

  • Python 3.8+
  • Node.js 18+ and npm
  • Convo-Lang CLI: npm i -g @convo-lang/convo-lang-cli
  • At least one LLM provider API key in the environment (e.g., OPENAI_API_KEY)

Authors

Maintainers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

convo_lang-0.6.2.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

convo_lang-0.6.2-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

Details for the file convo_lang-0.6.2.tar.gz.

File metadata

  • Download URL: convo_lang-0.6.2.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0rc2

File hashes

Hashes for convo_lang-0.6.2.tar.gz
Algorithm Hash digest
SHA256 75fea893c7b0775a0343ee77100fd41bb1907268c8e73b8bd95f68e15c61f5e4
MD5 cad0065f7463de81da737769dcfe7a4f
BLAKE2b-256 a96a22c9062220e826558b91779a8b52fb3ef49446299cc26c70d41838131a0c

See more details on using hashes here.

File details

Details for the file convo_lang-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: convo_lang-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0rc2

File hashes

Hashes for convo_lang-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b5383f418893ec19c82cfe610d6413a473b4e1349d85a409025e783a509a75b3
MD5 f3fec692261e7ea00f3712de8038fe56
BLAKE2b-256 f6e3de74f3bac4b7cb9e50eacc286b0dbf86c356f3710220f1499aa501e609ec

See more details on using hashes here.

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