Skip to main content

Public Python client for ChemFlow 3D chat editing

Project description

chemflow-client

Public Python client for ChemFlow 3D chat editing.

Supported Python versions: 3.9+

Install

pip install chemflow-client

Notebook widget support is optional:

pip install "chemflow-client[notebook]"

For contributors who want to run the full test suite:

pip install -e ".[dev,notebook]"

Usage

Blocking Python API:

from ase.build import molecule
from chemflow_client import chat3d

atoms = molecule("H2O")
updated_atoms, text = chat3d(
    prompt="change the H-O-H angle to 110 degrees",
    atoms=atoms,
)
# or generate one directly.
generated_atoms, text = chat3d(prompt="generate methane")

JupyterLab

Async notebook widget:

from chemflow_client import Chat3DWidget

widget = Chat3DWidget()
widget
widget.get_atoms()

JupyterLab widget demo

Configure

Create an API key at https://chemflow.cloud/user-center/api-keys.

You can configure the client with environment variables:

export CHEMFLOW_API_KEY="cfsk_xxx"

You can also pass configuration as arguments to chat3d(...) or Chat3DWidget(...):

from chemflow_client import Chat3DWidget, chat3d

updated_atoms, text = chat3d(
    prompt="generate methane",
    api_key="cfsk_xxx",
)

widget = Chat3DWidget(api_key="cfsk_xxx")

Call Signatures

chat3d(...)

chat3d(
    *,
    prompt: str,
    atoms: Optional[Atoms] = None,
    base_url: Optional[str] = None,
    api_key: Optional[str] = None,
    model: Optional[str] = None,
    timeout: float = 300.0,
) -> Tuple[Atoms, str]
  • prompt: Required keyword-only editing or generation instruction.
  • atoms: Optional initial ase.Atoms structure.
  • base_url, api_key, model, timeout: Optional client configuration overrides.
  • Returns (atoms, text).

Chat3DWidget(...)

Chat3DWidget(
    atoms: Optional[Atoms] = None,
    *,
    base_url: Optional[str] = None,
    api_key: Optional[str] = None,
    model: Optional[str] = None,
    timeout: float = 300.0,
)
  • atoms: Optional initial ase.Atoms structure.
  • base_url, api_key, model, timeout: Optional client configuration overrides.
  • Returns a notebook widget instance backed by ChemFlow3DClient.

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

chemflow_client-0.1.6.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

chemflow_client-0.1.6-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file chemflow_client-0.1.6.tar.gz.

File metadata

  • Download URL: chemflow_client-0.1.6.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chemflow_client-0.1.6.tar.gz
Algorithm Hash digest
SHA256 459bcd6ee9c5ab703b31c6377a1d2f4cfd85c3b175730509b1248f9f62115f4c
MD5 cf8f01056a91d61ce8950d4423e802d5
BLAKE2b-256 91a2609a0faaef06703b86c96d79d2f7f66dacdc0237142fddda0286d413fba5

See more details on using hashes here.

Provenance

The following attestation bundles were made for chemflow_client-0.1.6.tar.gz:

Publisher: publish.yml on SingletC/chemflow-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chemflow_client-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for chemflow_client-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 38efa99711f7f5ade2c2685bb13a1ae12e893015c6068ac323f7ad181c298fc2
MD5 26650528b87339448015ae02110cbff8
BLAKE2b-256 907067b194a5c999dd2b44a27b25b4a57a830eb1c13a5acaf12e32a01ddbf78e

See more details on using hashes here.

Provenance

The following attestation bundles were made for chemflow_client-0.1.6-py3-none-any.whl:

Publisher: publish.yml on SingletC/chemflow-client

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