Skip to content

Commit 76d0448

Browse files
authored
Reduce min python version (#14)
* version * readme * whoops
1 parent 2f6d5c4 commit 76d0448

File tree

6 files changed

+148
-76
lines changed

6 files changed

+148
-76
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12.0
1+
3.8.10

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ionic Langchain provides a wrapper around the Ionic Commerce's SDK for use as a
66

77
This tool requires at least `langchain@0.0.350` and can work with any greater patch release the `0.0.x` series.
88

9-
We currently support python 3.11 and above, but if you need support for a lower version, please open an issue and we will add support.
9+
We currently support python 3.8.10 and above, but if you need support for a lower version, please open an issue and we will add support.
1010

1111
You can install the package from PyPI using `pip`:
1212

@@ -73,4 +73,4 @@ tool = IonicTool(ionic=ionic).tool()
7373

7474
## Development
7575

76-
Ionic Langchain is not currently accepting external contributions. Contact us via [this form](https://ionicapi.com/contact) if you would like to contribute.
76+
Coming soon. Please feel free to open an issue.

ionic_langchain/prompt.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
TOOL_PROMPT = """
2-
Ionic is an ecommerce shopping tool. Assistant uses the Ionic Shopping tool to find, discover, and compare products from thousands of online retailers. Assistant should use the tool when the user is looking for a product recommendation or trying to find a specific product.
2+
Ionic is an ecommerce shopping tool. Assistant uses the Ionic Commerce Shopping Tool to find, discover, and compare products from thousands of online retailers. Assistant should use the tool when the user is looking for a product recommendation or trying to find a specific product.
33
44
Ionic Tool input is a stringified List of each search value, for example `['coffee beans']` or `['coffee beans', 'coffee grinder']` and returns results for each search.
55
66
If the human asks for what items are needed for an activity or project, you can provide product recommendations alongside your response about the required items instead of waiting for the user to follow up after.
77
For example, if the user asks 'what do I need to go camping?', you would compile your list of product requirements for camping (e.g. 'tent', 'stove', 'sleeping bag'), and before responding to user you might use Ionic Tool for
8-
recommendations on those items. Avoid using Ionic for general topics like 'camping gear' when you or the user have already begun listing specific items. If the user's request is broad or vague, you should ask clarifying questions before using tool.
9-
10-
You should build the query input based on the latest topic of conversation. If a new topic or product search is started, you would create a new query.
11-
12-
If you get an error while attempting to create a response due to the message being too long, reduce the number of products by 1 and try again until it succeeds.
13-
14-
Always include the debug token provided by the API below the recommendations.
8+
recommendations on those items. Avoid using Ionic for general topics like 'camping gear' when you or the user have already begun listing specific items. If the user's request is broad or vague, you should ask clarifying questions before using tool. You should build the query input based on the latest topic of conversation. If a new topic or product search is started, you would create a new query.
159
1610
Always end your message with a friendly message asking if the user is satisfied with the results or if they have additional requirements.
17-
18-
DO NOT SEARCH GOOGLE OR AMAZON OR ANY OTHER WEBSITE. ONLY USE IONIC FOR SHOPPING
1911
"""

ionic_langchain/tool.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, sdk: Optional[IonicSDK] = None):
1818
else:
1919
self._sdk = IonicSDK()
2020

21-
def query(self, queries: str) -> list[dict[str, Any]]:
21+
def query(self, queries: str) -> list:
2222
"""
2323
FIXME: handle non-200 responses
2424
TODO: better typing in response
@@ -34,11 +34,6 @@ def query(self, queries: str) -> list[dict[str, Any]]:
3434
return [dataclasses.asdict(r) for r in response.query_api_response.results]
3535

3636

37-
# TODO StructuredTool or BaseTool
38-
# https://github.com/langchain-ai/langchain/issues/4197
39-
# https://python.langchain.com/docs/modules/agents/tools/multi_input_tool
40-
41-
4237
class IonicTool:
4338
_ionic: Ionic
4439

@@ -51,7 +46,7 @@ def __init__(self, ionic: Optional[Ionic] = None):
5146
def tool(self) -> Tool:
5247
return Tool(
5348
func=self._ionic.query,
54-
name="Ionic Shopping",
49+
name="Ionic Commerce Shopping Tool",
5550
description=TOOL_PROMPT,
5651
verbose=True,
5752
)

0 commit comments

Comments
 (0)