regolo


Nameregolo JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummarySimple client to interact with regolo.ai
upload_time2025-02-04 14:56:13
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMIT License Copyright (c) 2025 regolo.ai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords chat llm regolo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # **Regolo.ai Python Client**

A simple Python client for interacting for **Regolo.ai's** LLM-based API.

## **Installation**
Ensure you have the `regolo` module installed. If not, install it using:

```bash
  pip install regolo
```

# **Basic Usage**

## **1. Import the regolo module**

```python
import regolo
```
 ## **2. Set Up Default API Key and Model**

To avoid manually passing the API key and model in every request, you can set them globally:

```python
regolo.default_key = "<EXAMPLE_KEY>"
regolo.default_model = "meta-llama/Llama-3.3-70B-Instruct"
```

This ensures that all `RegoloClient` instances and static functions will
use the specified API key and model.

Still, you can create run methods by passing model and key directly.

 ## **3. Perform a basic request**

### Completion:
```python
print(regolo.static_completions(prompt="Tell me something about Rome."))
```

### Chat_completion
```python
print(regolo.static_chat_completions(messages=[{"role": "user", "content": "Tell me something about rome"}]))
```

---

# **Other usages**

## **Handling streams**


**With full output:**

```python
import regolo
regolo.default_key = "<EXAMPLE_KEY>"
regolo.default_model = "meta-llama/Llama-3.3-70B-Instruct"

# Completions

client = regolo.RegoloClient()
response = client.completions("Tell me about Rome in a concise manner", full_output=True, stream=True)

while True:
    try:
        print(next(response))
    except StopIteration:
        break

# Chat completions

client = regolo.RegoloClient()
response = client.run_chat(user_prompt="Tell me about Rome in a concise manner", full_output=True, stream=True)


while True:
    try:
        print(next(response))
    except StopIteration:
        break
```

**Without full output:**

```python
import regolo
regolo.default_key = "<EXAMPLE_KEY>"
regolo.default_model = "meta-llama/Llama-3.3-70B-Instruct"

# Completions

client = regolo.RegoloClient()
response = client.completions("Tell me about Rome in a concise manner", full_output=True, stream=True)

while True:
    try:
        print(next(response), end='', flush=True)
    except StopIteration:
        break

# Chat completions

client = regolo.RegoloClient()
response = client.run_chat(user_prompt="Tell me about Rome in a concise manner", full_output=True, stream=True)

while True:
    try:
        res = next(response)
        if res[0]:
            print(res[0] + ":")
        print(res[1], end="", flush=True)
    except StopIteration:
        break
```

## **Handling chat through add_prompt_to_chat()**

```python
import regolo

regolo.default_key = "<EXAMPLE_KEY>"
regolo.default_model = "meta-llama/Llama-3.3-70B-Instruct"

client = regolo.RegoloClient()

# Make a request

client.add_prompt_to_chat(role="user", prompt="Tell me about rome!")

print(client.run_chat())

# Continue the conversation

client.add_prompt_to_chat(role="user", prompt="Tell me something more about it!")

print(client.run_chat())

# You can print the whole conversation if needed

print(client.instance.get_conversation())
```

It is to consider that using the user_prompt parameter in run_chat() is equivalent to adding a prompt with role=user
through add_prompt_to_chat().

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "regolo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "chat, llm, regolo",
    "author": null,
    "author_email": "\"regolo.ai\" <dev@regolo.ai>",
    "download_url": "https://files.pythonhosted.org/packages/c7/74/2a5a016ca693901213abe2dc1868f3db476f610d904fb6fb0389881d1ce3/regolo-1.0.2.tar.gz",
    "platform": null,
    "description": "# **Regolo.ai Python Client**\n\nA simple Python client for interacting for **Regolo.ai's** LLM-based API.\n\n## **Installation**\nEnsure you have the `regolo` module installed. If not, install it using:\n\n```bash\n  pip install regolo\n```\n\n# **Basic Usage**\n\n## **1. Import the regolo module**\n\n```python\nimport regolo\n```\n ## **2. Set Up Default API Key and Model**\n\nTo avoid manually passing the API key and model in every request, you can set them globally:\n\n```python\nregolo.default_key = \"<EXAMPLE_KEY>\"\nregolo.default_model = \"meta-llama/Llama-3.3-70B-Instruct\"\n```\n\nThis ensures that all `RegoloClient` instances and static functions will\nuse the specified API key and model.\n\nStill, you can create run methods by passing model and key directly.\n\n ## **3. Perform a basic request**\n\n### Completion:\n```python\nprint(regolo.static_completions(prompt=\"Tell me something about Rome.\"))\n```\n\n### Chat_completion\n```python\nprint(regolo.static_chat_completions(messages=[{\"role\": \"user\", \"content\": \"Tell me something about rome\"}]))\n```\n\n---\n\n# **Other usages**\n\n## **Handling streams**\n\n\n**With full output:**\n\n```python\nimport regolo\nregolo.default_key = \"<EXAMPLE_KEY>\"\nregolo.default_model = \"meta-llama/Llama-3.3-70B-Instruct\"\n\n# Completions\n\nclient = regolo.RegoloClient()\nresponse = client.completions(\"Tell me about Rome in a concise manner\", full_output=True, stream=True)\n\nwhile True:\n    try:\n        print(next(response))\n    except StopIteration:\n        break\n\n# Chat completions\n\nclient = regolo.RegoloClient()\nresponse = client.run_chat(user_prompt=\"Tell me about Rome in a concise manner\", full_output=True, stream=True)\n\n\nwhile True:\n    try:\n        print(next(response))\n    except StopIteration:\n        break\n```\n\n**Without full output:**\n\n```python\nimport regolo\nregolo.default_key = \"<EXAMPLE_KEY>\"\nregolo.default_model = \"meta-llama/Llama-3.3-70B-Instruct\"\n\n# Completions\n\nclient = regolo.RegoloClient()\nresponse = client.completions(\"Tell me about Rome in a concise manner\", full_output=True, stream=True)\n\nwhile True:\n    try:\n        print(next(response), end='', flush=True)\n    except StopIteration:\n        break\n\n# Chat completions\n\nclient = regolo.RegoloClient()\nresponse = client.run_chat(user_prompt=\"Tell me about Rome in a concise manner\", full_output=True, stream=True)\n\nwhile True:\n    try:\n        res = next(response)\n        if res[0]:\n            print(res[0] + \":\")\n        print(res[1], end=\"\", flush=True)\n    except StopIteration:\n        break\n```\n\n## **Handling chat through add_prompt_to_chat()**\n\n```python\nimport regolo\n\nregolo.default_key = \"<EXAMPLE_KEY>\"\nregolo.default_model = \"meta-llama/Llama-3.3-70B-Instruct\"\n\nclient = regolo.RegoloClient()\n\n# Make a request\n\nclient.add_prompt_to_chat(role=\"user\", prompt=\"Tell me about rome!\")\n\nprint(client.run_chat())\n\n# Continue the conversation\n\nclient.add_prompt_to_chat(role=\"user\", prompt=\"Tell me something more about it!\")\n\nprint(client.run_chat())\n\n# You can print the whole conversation if needed\n\nprint(client.instance.get_conversation())\n```\n\nIt is to consider that using the user_prompt parameter in run_chat() is equivalent to adding a prompt with role=user\nthrough add_prompt_to_chat().\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 regolo.ai\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Simple client to interact with regolo.ai",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/regolo-ai/python-client"
    },
    "split_keywords": [
        "chat",
        " llm",
        " regolo"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5a6b7f0ddc789a0c8206bbb3aa2d84a66da0e375fe96177a652db11a00c73a4d",
                "md5": "b96912e51b874cd0badf904cab3ba9bb",
                "sha256": "70bd3fb4f7323c215c6f85bf55f0c6b6986d812c332fdbdf5a5bd6d2e25a1263"
            },
            "downloads": -1,
            "filename": "regolo-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b96912e51b874cd0badf904cab3ba9bb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 12536,
            "upload_time": "2025-02-04T14:56:12",
            "upload_time_iso_8601": "2025-02-04T14:56:12.189340Z",
            "url": "https://files.pythonhosted.org/packages/5a/6b/7f0ddc789a0c8206bbb3aa2d84a66da0e375fe96177a652db11a00c73a4d/regolo-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c7742a5a016ca693901213abe2dc1868f3db476f610d904fb6fb0389881d1ce3",
                "md5": "7d93f79b1df9763c9e8737f296032097",
                "sha256": "9840a21c918ecdeb838863914a9d0b85592903114d8b9f07b1c4c52fde4e8165"
            },
            "downloads": -1,
            "filename": "regolo-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "7d93f79b1df9763c9e8737f296032097",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 11952,
            "upload_time": "2025-02-04T14:56:13",
            "upload_time_iso_8601": "2025-02-04T14:56:13.581416Z",
            "url": "https://files.pythonhosted.org/packages/c7/74/2a5a016ca693901213abe2dc1868f3db476f610d904fb6fb0389881d1ce3/regolo-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-04 14:56:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "regolo-ai",
    "github_project": "python-client",
    "github_not_found": true,
    "lcname": "regolo"
}
        
Elapsed time: 0.46775s