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

Uploaded Python 3

File details

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

File metadata

  • Download URL: chemflow_client-0.1.7.tar.gz
  • Upload date:
  • Size: 17.7 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.7.tar.gz
Algorithm Hash digest
SHA256 c89ad15802d6f542128b5f65c5e975a302efcf32c572567607a6813de79b6027
MD5 ef0465378bbf811f281a2391d3cacc03
BLAKE2b-256 d91ec495e20f8e2058860197b56fe9446e0b6352f787bf42dc96e078fb7b7409

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for chemflow_client-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a872a9a3d7c487567bc18f28857bc6fb9dcc223ac2447d597d28fe808fa2cfc0
MD5 1ac6ad6f14b8b5f78bee7d2a3ae7552e
BLAKE2b-256 a9d5cbb28d7d81d8d69817392bb6a4c03692f281b6c263caa4a579cca1e5d4d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for chemflow_client-0.1.7-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