pytool-directory


Namepytool-directory JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryPython package to create langchain tool from the Tool Directory For LangChain.
upload_time2024-05-09 02:37:44
maintainerNone
docs_urlNone
authorSheile
requires_python>=3.9
licenseMIT
keywords langchain gpt dialogplay
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pytool-directory
=========================
[![Unittest](https://github.com/dialogplay/pytool-directory/actions/workflows/unittest.yaml/badge.svg)](https://github.com/dialogplay/pytool-directory/actions/workflows/unittest.yaml)

Python package to create the [LangChain](https://github.com/langchain-ai/langchain) tool from the [Tool Directory For LangChain](https://github.com/dialogplay/tool-directory/).

Can create LangChain tool from definition in the Tool Directory.

Installation
-------------------------
```bash
pip install pytool-directory
```

Usage
-------------------------
1. Search tools for your destination from [Tool Directory For LangChain](https://github.com/dialogplay/tool-directory).
2. Load tools from the name of integration.
```python
from tool_directory import ToolLoader
tools = ToolLoader('openweather').get_tools(parameters={'appid': 'YOUR_APP_ID_FOR_OPENWEATHER'})
```
3. Ask question to LLM with tools.
```python
llm = ChatOpenAI(temperature=0, model_name='gpt-4')
agent = initialize_agent(tools, llm, agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
answer = agent('Please tell me about the temperature in tokyo.')
```

Examples
-------------------------
### [langchain_with_tools.py](https://github.com/dialogplay/pytool-directory/blob/main/examples/langchain_with_tools.py)
Use a tool for the OpenWeather API to get the weather information on specified location.

This example execute following conversation via ChatGPT.

```text
User: Please tell me about the temperature in tokyo.
Bot: The current temperature in Tokyo is 29.54°C, but it feels like 32.72°C. The minimum and maximum temperatures today are 27.74°C and 30.45°C respectively. The humidity is 64%.
```

Contribution
-------------------------
1. Fork and clone repository.
2. Install development dependencies.
```bash
pip install '.[dev]'
```

3. Install pre-commit hook for linter and formatter.
```bash
pre-commit install
```

4. Commit your changes and send pull request.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytool-directory",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "langchain, gpt, dialogplay",
    "author": "Sheile",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/c2/c1/f0328daed98cb7bed2388afa9917a0c9a98fa641cc64e9357c6ad4575e80/pytool_directory-0.0.2.tar.gz",
    "platform": null,
    "description": "pytool-directory\n=========================\n[![Unittest](https://github.com/dialogplay/pytool-directory/actions/workflows/unittest.yaml/badge.svg)](https://github.com/dialogplay/pytool-directory/actions/workflows/unittest.yaml)\n\nPython package to create the [LangChain](https://github.com/langchain-ai/langchain) tool from the [Tool Directory For LangChain](https://github.com/dialogplay/tool-directory/).\n\nCan create LangChain tool from definition in the Tool Directory.\n\nInstallation\n-------------------------\n```bash\npip install pytool-directory\n```\n\nUsage\n-------------------------\n1. Search tools for your destination from [Tool Directory For LangChain](https://github.com/dialogplay/tool-directory).\n2. Load tools from the name of integration.\n```python\nfrom tool_directory import ToolLoader\ntools = ToolLoader('openweather').get_tools(parameters={'appid': 'YOUR_APP_ID_FOR_OPENWEATHER'})\n```\n3. Ask question to LLM with tools.\n```python\nllm = ChatOpenAI(temperature=0, model_name='gpt-4')\nagent = initialize_agent(tools, llm, agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION, verbose=True)\nanswer = agent('Please tell me about the temperature in tokyo.')\n```\n\nExamples\n-------------------------\n### [langchain_with_tools.py](https://github.com/dialogplay/pytool-directory/blob/main/examples/langchain_with_tools.py)\nUse a tool for the OpenWeather API to get the weather information on specified location.\n\nThis example execute following conversation via ChatGPT.\n\n```text\nUser: Please tell me about the temperature in tokyo.\nBot: The current temperature in Tokyo is 29.54\u00b0C, but it feels like 32.72\u00b0C. The minimum and maximum temperatures today are 27.74\u00b0C and 30.45\u00b0C respectively. The humidity is 64%.\n```\n\nContribution\n-------------------------\n1. Fork and clone repository.\n2. Install development dependencies.\n```bash\npip install '.[dev]'\n```\n\n3. Install pre-commit hook for linter and formatter.\n```bash\npre-commit install\n```\n\n4. Commit your changes and send pull request.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python package to create langchain tool from the Tool Directory For LangChain.",
    "version": "0.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/dialogplay/pytool-directory/issues",
        "Homepage": "https://github.com/dialogplay/pytool-directory",
        "Source": "https://github.com/dialogplay/pytool-directory"
    },
    "split_keywords": [
        "langchain",
        " gpt",
        " dialogplay"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a16995a8d8095415c4c66c56b529b89829748ce2785209d5af81f06493bc7614",
                "md5": "755a5d3b5cbb1f9ba41282de335ea986",
                "sha256": "fed08fdaad3fc87ddc6e0e3416fdab9f99400496e20e396b126fb3edcea7c90c"
            },
            "downloads": -1,
            "filename": "pytool_directory-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "755a5d3b5cbb1f9ba41282de335ea986",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6711,
            "upload_time": "2024-05-09T02:37:42",
            "upload_time_iso_8601": "2024-05-09T02:37:42.383484Z",
            "url": "https://files.pythonhosted.org/packages/a1/69/95a8d8095415c4c66c56b529b89829748ce2785209d5af81f06493bc7614/pytool_directory-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c2c1f0328daed98cb7bed2388afa9917a0c9a98fa641cc64e9357c6ad4575e80",
                "md5": "f3874b64cfbef4a5efdfed49f4d048ec",
                "sha256": "644b5212d5412af12787a55db71ed0b728e2c9ca0436da4a362442dd78f0a772"
            },
            "downloads": -1,
            "filename": "pytool_directory-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "f3874b64cfbef4a5efdfed49f4d048ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5817,
            "upload_time": "2024-05-09T02:37:44",
            "upload_time_iso_8601": "2024-05-09T02:37:44.192848Z",
            "url": "https://files.pythonhosted.org/packages/c2/c1/f0328daed98cb7bed2388afa9917a0c9a98fa641cc64e9357c6ad4575e80/pytool_directory-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-09 02:37:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dialogplay",
    "github_project": "pytool-directory",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pytool-directory"
}
        
Elapsed time: 0.27096s