Skip to main content

A Python wrapper for the Mercury API with streaming support.

Project description

Mercury4Free Wrapper

A Python wrapper for the Mercury web API.

Installation

pip install Mercury4Free

Basic Usage

from Mercury4Free.mercury import MercuryClient

client = MercuryClient()
response = client.send_message("What's the weather like?", reasoning_effort="medium")
print(response)

Methods

send_message(prompt, reasoning_effort="medium")

Returns the full response as a string.

stream_chat(messages, reasoning_effort="medium")

Generates a stream of tuples: (message_type, content).

  • message_type: "text", "reasoning", "reasoning_start", "reasoning_end", "text_start", "text_end", "debug", "error", "done"
  • content: The text/reasoning token, error message, or raw JSON object for signaling types.

Reasoning Effort

The reasoning_effort must be one of:

  • instant
  • low
  • medium
  • high

If an invalid value is provided, a ValueError will be raised.

Feel free to fork, star, and use this wrapper in your projects! (Not affiliated with Inception Labs and could be taken down at any time)

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

mercury4free-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

mercury4free-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file mercury4free-0.1.0.tar.gz.

File metadata

  • Download URL: mercury4free-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for mercury4free-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad403dd5c883f8662919b1dbb9187579b9285901731fb87c912e76557ad28dd0
MD5 f83df14649a4facf51f1b7a3783527b2
BLAKE2b-256 76677558e8438b8926b0c521cd9d83af392876735594850a50d23f22ca6d6168

See more details on using hashes here.

File details

Details for the file mercury4free-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mercury4free-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for mercury4free-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 620223520f4852c3c76e58f6eb79d95d85d8f64e976a10da8bcd3377739e8a62
MD5 43650177f94821914eea962b893f3245
BLAKE2b-256 9d10a0cf4d4a4c277950cb296b3f95db3d880627b8ebf421f2faab2e13b21387

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