Name | gwenflow JSON |
Version |
0.7.6
JSON |
| download |
home_page | None |
Summary | A framework for orchestrating applications powered by autonomous AI agents and LLMs. |
upload_time | 2025-07-08 14:25:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | MIT License
Copyright (c) 2024 Gwenlake
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 |
gwenflow
gwenlake
agents
llms
ai
ml
nlp
framework
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="center">

**A framework for orchestrating applications powered by autonomous AI agents and LLMs.**
[](https://opensource.org/licenses/MIT)
[](https://github.com/your-username/gwenflow/releases)
</div>
## Why Gwenflow?
Gwenflow, a framework designed by [Gwenlake](https://gwenlake.com),
streamlines the creation of customized, production-ready applications built around Agents and
Large Language Models (LLMs). It provides developers with the tools necessary
to integrate LLMs and Agents, enabling efficient and
scalable solutions tailored to specific business or user needs.
## Installation
Install from PyPI:
```bash
pip install gwenflow
```
Install from the main branch to try the newest features:
```bash
# install from Github
pip install -U git+https://github.com/gwenlake/gwenflow.git@main
```
## Usage
Load your OpenAI api key from an environment variable:
```python
import os
from gwenflow import ChatOpenAI
llm = ChatOpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
```
or load your api key from a local .env file:
```python
import os
import dotenv
from gwenflow import ChatOpenAI
dotenv.load_dotenv(override=True) # load you api key from .env
llm = ChatOpenAI()
```
## Chat
```python
import os
from gwenflow import ChatOpenAI
dotenv.load_dotenv(override=True) # load you api key from .env
messages = [
{
"role": "user",
"content": "Describe Argentina in one sentence."
}
]
llm = ChatOpenAI(model="gpt-4o-mini")
print(llm.invoke(messages=messages))
```
## Agents
```python
import requests
import json
import dotenv
from gwenflow import ChatOpenAI, Agent, FunctionTool
dotenv.load_dotenv(override=True)
def get_exchange_rate(currency_iso: str) -> str:
"""Get the current exchange rate for a given currency. Currency MUST be in iso format."""
try:
response = requests.get("http://www.floatrates.com/daily/usd.json").json()
data = response[currency_iso.lower()]
return json.dumps(data)
except Exception as e:
print(f"Currency not found: {currency_iso}")
return "Currency not found"
tool_get_exchange_rate = FunctionTool.from_function(get_exchange_rate)
llm = ChatOpenAI(model="gpt-4o-mini")
agent = Agent(
name="AgentFX",
instructions=[
"Your role is to get exchange rates data.",
"Answer in one sentence and if there is a date, mention this date.",
],
llm=llm,
tools=[tool_get_exchange_rate],
)
queries = [
"Find the capital city of France?",
"What's the exchange rate of the Brazilian real?",
"What's the exchange rate of the Euro?",
"What's the exchange rate of the Chine Renminbi?",
"What's the exchange rate of the Chinese Yuan?",
"What's the exchange rate of the Tonga?"
]
for query in queries:
print("")
print("Q:", query)
print("A:", agent.run(query).content)
```
```
Q: Find the capital city of France?
A: The capital city of France is Paris, which is not only the largest city in the country but also a major global center for art, fashion, and culture. Located in the north-central part of France along the Seine River, Paris is renowned for its iconic landmarks such as the Eiffel Tower, the Louvre Museum, and the Notre-Dame Cathedral. The city has a rich history dating back to its founding in the 3rd century BC as a small fishing village, and over the centuries, it has evolved into a vibrant metropolis known for its stylish boulevards, world-class cuisine, and significant historical events. Paris also serves as the political and administrative hub of France, housing key government institutions, including the Élysée Palace, where the French President resides.
Q: What's the exchange rate of the Brazilian real?
A: As of January 10, 2025, the exchange rate for the Brazilian Real (BRL) is approximately 6.0604 BRL to 1 USD, with an inverse rate of about 0.1650 USD for 1 BRL. This means that for every Brazilian Real, you can exchange it for about 16.5 cents in US dollars.
Q: What's the exchange rate of the Euro?
A: As of January 10, 2025, the exchange rate for the Euro (EUR) is approximately 0.9709 against the US Dollar, meaning 1 Euro can be exchanged for about 0.9709 USD; conversely, the inverse rate indicates that 1 USD is equivalent to about 1.0300 Euros.
Q: What's the exchange rate of the Chine Renminbi?
A: As of January 10, 2025, the exchange rate for the Chinese Renminbi (CNY), also known as the Chinese Yuan, is approximately 7.33 CNY per 1 USD. Additionally, the inverse rate indicates that 1 CNY is equivalent to about 0.1364 USD. This rate is important for various financial transactions, including trade, investments, and tourism related to China, reflecting the currency's strength in the global market as observed at 15:55 GMT on the same date.
Q: What's the exchange rate of the Chinese Yuan?
A: As of January 10, 2025, the exchange rate for the Chinese Yuan (CNY) is approximately 7.33 CNY to 1 USD, with an inverse rate of about 0.14 USD for each CNY, reflecting its value in the global market. This data indicates the strength of the yuan against the US dollar, and it is essential for understanding its purchasing power and economic interactions, especially for businesses and individuals engaging in international transactions.
Q: What's the exchange rate of the Tonga?
A: As of January 10, 2025, the current exchange rate for the Tongan paʻanga (ISO code: TOP) is approximately 2.42 TOP per 1 USD, while the inverse rate is around 0.41 USD per 1 TOP. The Tongan paʻanga is denoted by the numeric code 776, and the latest exchange data indicates that the rate was last updated at 15:55:14 GMT on the same day.
```
## Agents and Langchain Tools
```python
import requests
import json
import dotenv
from gwenflow import ChatOpenAI, Agent, FunctionTool
from langchain_community.tools import WikipediaQueryRun
from langchain_community.utilities import WikipediaAPIWrapper
dotenv.load_dotenv(override=True)
api_wrapper = WikipediaAPIWrapper(top_k_results=1, doc_content_chars_max=500)
wikipedia = WikipediaQueryRun(api_wrapper=api_wrapper)
tool_wikipedia = FunctionTool.from_langchain( wikipedia )
agent = Agent(
name="Helpful Analyst",
instructions=["Get some useful information about my request", "Answer as precisely as possible."],
llm=ChatOpenAI(model="gpt-4o-mini"),
tools=[tool_wikipedia],
)
response = agent.run("Summarize the wikipedia's page about Winston Churchill.")
print(response.content)
```
## Contributing to Gwenflow
We are very open to the community's contributions - be it a quick fix of a typo, or a completely new feature! You don't
need to be a Gwenflow expert to provide meaningful improvements.
Raw data
{
"_id": null,
"home_page": null,
"name": "gwenflow",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "gwenflow, gwenlake, agents, llms, ai, ml, nlp, framework",
"author": null,
"author_email": "Gwenlake <info@gwenlake.com>, Sylvain Barth\u00e9l\u00e9my <sylvain.barthelemy@gwenlake.com>, Guillaume Beguec <guillaume.beguec@gwenlake.com>, Antoine de Parthenay <antoine.departhenay@gwenlake.com>",
"download_url": "https://files.pythonhosted.org/packages/b6/f8/0339e5e72e4372a562ae23db1456ba3bb75e53a15e5dfa88a60aa1b711af/gwenflow-0.7.6.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n\n\n**A framework for orchestrating applications powered by autonomous AI agents and LLMs.**\n\n[](https://opensource.org/licenses/MIT)\n[](https://github.com/your-username/gwenflow/releases)\n\n\n</div>\n\n## Why Gwenflow?\n\nGwenflow, a framework designed by [Gwenlake](https://gwenlake.com),\nstreamlines the creation of customized, production-ready applications built around Agents and\nLarge Language Models (LLMs). It provides developers with the tools necessary\nto integrate LLMs and Agents, enabling efficient and\nscalable solutions tailored to specific business or user needs.\n\n## Installation\n\nInstall from PyPI:\n\n```bash\npip install gwenflow\n```\n\nInstall from the main branch to try the newest features:\n\n```bash\n# install from Github\npip install -U git+https://github.com/gwenlake/gwenflow.git@main\n```\n\n## Usage\n\nLoad your OpenAI api key from an environment variable:\n\n```python\nimport os\nfrom gwenflow import ChatOpenAI\n\nllm = ChatOpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\n```\n\nor load your api key from a local .env file:\n\n```python\nimport os\nimport dotenv\nfrom gwenflow import ChatOpenAI\n\ndotenv.load_dotenv(override=True) # load you api key from .env\n\nllm = ChatOpenAI()\n```\n\n## Chat\n\n```python\nimport os\nfrom gwenflow import ChatOpenAI\n\ndotenv.load_dotenv(override=True) # load you api key from .env\n\nmessages = [\n {\n \"role\": \"user\",\n \"content\": \"Describe Argentina in one sentence.\"\n }\n]\n\nllm = ChatOpenAI(model=\"gpt-4o-mini\")\nprint(llm.invoke(messages=messages))\n```\n\n\n## Agents\n\n```python\nimport requests\nimport json\nimport dotenv\n\nfrom gwenflow import ChatOpenAI, Agent, FunctionTool\n\ndotenv.load_dotenv(override=True)\n\n\ndef get_exchange_rate(currency_iso: str) -> str:\n \"\"\"Get the current exchange rate for a given currency. Currency MUST be in iso format.\"\"\"\n try:\n response = requests.get(\"http://www.floatrates.com/daily/usd.json\").json()\n data = response[currency_iso.lower()]\n return json.dumps(data)\n except Exception as e:\n print(f\"Currency not found: {currency_iso}\")\n return \"Currency not found\"\n\n\ntool_get_exchange_rate = FunctionTool.from_function(get_exchange_rate)\n\nllm = ChatOpenAI(model=\"gpt-4o-mini\")\n\nagent = Agent(\n name=\"AgentFX\",\n instructions=[\n \"Your role is to get exchange rates data.\",\n \"Answer in one sentence and if there is a date, mention this date.\",\n ],\n llm=llm,\n tools=[tool_get_exchange_rate],\n)\n\nqueries = [\n \"Find the capital city of France?\",\n \"What's the exchange rate of the Brazilian real?\",\n \"What's the exchange rate of the Euro?\",\n \"What's the exchange rate of the Chine Renminbi?\",\n \"What's the exchange rate of the Chinese Yuan?\",\n \"What's the exchange rate of the Tonga?\"\n]\n\nfor query in queries:\n print(\"\")\n print(\"Q:\", query)\n print(\"A:\", agent.run(query).content)\n```\n\n```\nQ: Find the capital city of France?\nA: The capital city of France is Paris, which is not only the largest city in the country but also a major global center for art, fashion, and culture. Located in the north-central part of France along the Seine River, Paris is renowned for its iconic landmarks such as the Eiffel Tower, the Louvre Museum, and the Notre-Dame Cathedral. The city has a rich history dating back to its founding in the 3rd century BC as a small fishing village, and over the centuries, it has evolved into a vibrant metropolis known for its stylish boulevards, world-class cuisine, and significant historical events. Paris also serves as the political and administrative hub of France, housing key government institutions, including the \u00c9lys\u00e9e Palace, where the French President resides.\n\nQ: What's the exchange rate of the Brazilian real?\nA: As of January 10, 2025, the exchange rate for the Brazilian Real (BRL) is approximately 6.0604 BRL to 1 USD, with an inverse rate of about 0.1650 USD for 1 BRL. This means that for every Brazilian Real, you can exchange it for about 16.5 cents in US dollars.\n\nQ: What's the exchange rate of the Euro?\nA: As of January 10, 2025, the exchange rate for the Euro (EUR) is approximately 0.9709 against the US Dollar, meaning 1 Euro can be exchanged for about 0.9709 USD; conversely, the inverse rate indicates that 1 USD is equivalent to about 1.0300 Euros.\n\nQ: What's the exchange rate of the Chine Renminbi?\nA: As of January 10, 2025, the exchange rate for the Chinese Renminbi (CNY), also known as the Chinese Yuan, is approximately 7.33 CNY per 1 USD. Additionally, the inverse rate indicates that 1 CNY is equivalent to about 0.1364 USD. This rate is important for various financial transactions, including trade, investments, and tourism related to China, reflecting the currency's strength in the global market as observed at 15:55 GMT on the same date.\n\nQ: What's the exchange rate of the Chinese Yuan?\nA: As of January 10, 2025, the exchange rate for the Chinese Yuan (CNY) is approximately 7.33 CNY to 1 USD, with an inverse rate of about 0.14 USD for each CNY, reflecting its value in the global market. This data indicates the strength of the yuan against the US dollar, and it is essential for understanding its purchasing power and economic interactions, especially for businesses and individuals engaging in international transactions.\n\nQ: What's the exchange rate of the Tonga?\nA: As of January 10, 2025, the current exchange rate for the Tongan pa\u02bbanga (ISO code: TOP) is approximately 2.42 TOP per 1 USD, while the inverse rate is around 0.41 USD per 1 TOP. The Tongan pa\u02bbanga is denoted by the numeric code 776, and the latest exchange data indicates that the rate was last updated at 15:55:14 GMT on the same day.\n```\n\n## Agents and Langchain Tools\n\n```python\nimport requests\nimport json\nimport dotenv\n\nfrom gwenflow import ChatOpenAI, Agent, FunctionTool\n\nfrom langchain_community.tools import WikipediaQueryRun\nfrom langchain_community.utilities import WikipediaAPIWrapper\n\ndotenv.load_dotenv(override=True)\n\napi_wrapper = WikipediaAPIWrapper(top_k_results=1, doc_content_chars_max=500)\nwikipedia = WikipediaQueryRun(api_wrapper=api_wrapper)\n\ntool_wikipedia = FunctionTool.from_langchain( wikipedia )\n\nagent = Agent(\n name=\"Helpful Analyst\",\n instructions=[\"Get some useful information about my request\", \"Answer as precisely as possible.\"],\n llm=ChatOpenAI(model=\"gpt-4o-mini\"),\n tools=[tool_wikipedia],\n)\n\nresponse = agent.run(\"Summarize the wikipedia's page about Winston Churchill.\")\nprint(response.content)\n```\n\n## Contributing to Gwenflow\n\nWe are very open to the community's contributions - be it a quick fix of a typo, or a completely new feature! You don't\nneed to be a Gwenflow expert to provide meaningful improvements.\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2024 Gwenlake\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": "A framework for orchestrating applications powered by autonomous AI agents and LLMs.",
"version": "0.7.6",
"project_urls": {
"Homepage": "https://gwenlake.com",
"Source": "https://github.com/gwenlake/gwenflow"
},
"split_keywords": [
"gwenflow",
" gwenlake",
" agents",
" llms",
" ai",
" ml",
" nlp",
" framework"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "cddca5a5c9252df758f2c406ce9d9846443a2902b27afa03e78883f313f12f54",
"md5": "0d8549fba8994acca8e55d0e06b53c0e",
"sha256": "b8063f10642044f16ef79aff5d215d8e3b3ef6aee854bb07b06451b2f877edd5"
},
"downloads": -1,
"filename": "gwenflow-0.7.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0d8549fba8994acca8e55d0e06b53c0e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 77675,
"upload_time": "2025-07-08T14:25:39",
"upload_time_iso_8601": "2025-07-08T14:25:39.403000Z",
"url": "https://files.pythonhosted.org/packages/cd/dc/a5a5c9252df758f2c406ce9d9846443a2902b27afa03e78883f313f12f54/gwenflow-0.7.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b6f80339e5e72e4372a562ae23db1456ba3bb75e53a15e5dfa88a60aa1b711af",
"md5": "d5ea335d1f90ebc7be3874f8eed4656b",
"sha256": "f2a96c7416a30ec6bd968c07cb91160359043399561526a1b24a7f9f1bb8bfb6"
},
"downloads": -1,
"filename": "gwenflow-0.7.6.tar.gz",
"has_sig": false,
"md5_digest": "d5ea335d1f90ebc7be3874f8eed4656b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 57967,
"upload_time": "2025-07-08T14:25:41",
"upload_time_iso_8601": "2025-07-08T14:25:41.263637Z",
"url": "https://files.pythonhosted.org/packages/b6/f8/0339e5e72e4372a562ae23db1456ba3bb75e53a15e5dfa88a60aa1b711af/gwenflow-0.7.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-08 14:25:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gwenlake",
"github_project": "gwenflow",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gwenflow"
}