Skip to content

Conversation

@gmkohler
Copy link
Contributor

@gmkohler gmkohler commented Dec 20, 2023

Query only accepts 1 query now, and extra parameters are commas-separated values in the 1 input string.

Screenshot 2024-01-23 at 09 55 47

The query was: 'query': {'query': 'hair dryers', 'max_price': 50000, 'min_price': 10000, 'num_results': 7}

@linear
Copy link

linear bot commented Dec 20, 2023

@gmkohler gmkohler force-pushed the gmkohler/ION-281 branch 7 times, most recently from 0507518 to 69465f9 Compare December 21, 2023 17:28
stewartjarod and others added 6 commits January 18, 2024 13:53
* 📦 upgrade SDK to 0.5.3 (#3)

* tests

* 📦 update ionic-sdk-python

* 🏷️ bump version

* inject ionic into tool (#4)

* let ionic be injected into tool

* 🏷️ bump version

* 📖 [ION-283] document langchain tool (#5)

* 📦 fleixble langchain dependency; pinned sdk

Idea here being we control which SDK version is being used but
allow developers to have higher patch versions of langchain.

https://python-poetry.org/docs/dependency-specification/#tilde-requirements

* 📖 first pass at documentation

* Update README.md

* 👷‍♂️📦🏷️ [ION-285] workflow for publishing new releases (#7)

* 👷‍♂️📦 workflow for publishing new releases

Right now this requires manually bumping poetry and creating a
git release but I added a couple of guardrails so that we ensure
we only publish when the poetry package version matches the github
release reference.

Future iteration will move the version bumping and release cutting
to the workflow.

* 🏷️ bump verison to 0.1.3

want something to test with when this merges

* set workflow up for iterative testing

* dry run for publishing
* warn instead of fail if tag checks fail

* 👷‍♂️ [ION-285] release publication workflow fixups (#8)

* 📌 pin python version

* 🐛 use ref_name instead of ref

ref is a lot longer, e.g. 'refs/heads/gmkohler/ION-285'
found with debug logging

* 🏷️ bump patch version

want to compare with new release

* 👷‍♂️ [ION-285] Revert "set workflow up for iterative testing" (#10)

* Revert "set workflow up for iterative testing"

This reverts commit 49cc39f.

* 🏷️ bump version to 0.1.5

want to test the release guardrails

* 👷‍♂️ [ION-285] adjust github expressions (#11)

* tidy expressions up

think it all needs to be interpolated

* 🏷️ poetry version patch

need to verify new changes

* 👷‍♂️ [ION-285] automate version bumping / tagging in release workflow (#9)

* 👷‍♂️ bump version within workflow

* ☑️ use type: choice for release input

This should enforce a dropdown

* fix release-action name

* tidy release step

* 🏷️ prepare version v0.1.7 for release

* 🏷️ prepare version v0.1.8 for release

* 📖 add sentence re: python version support (#12)

* 📖 install library from PyPI instead of GitHub (#13)

* Reduce min python version (#14)

* version

* readme

* whoops

* working example (#15)

---------

Co-authored-by: Gregory M Kohler <gregory@ionicapi.com>
Co-authored-by: gmkohler <gmkohler@users.noreply.github.com>
Co-authored-by: Owen Sims <owen@ionicapi.com>
@stewartjarod stewartjarod marked this pull request as ready for review January 19, 2024 17:08
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. The user can specify the number of results, minimum price, and maximum price that they want to see results for.
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.
Ionic Tool input is a comma seperated string of values: query (required), number of results, minimum price, and maximum price. For example `coffee beans, 2, 5, 10` or `coffee beans, 2` or `coffee beans, 2, 5` or `coffee beans, 2, , 10`. If the user has not specified how many results they want, use 5 as the default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

price as cents?

@@ -1,7 +1,7 @@
TOOL_PROMPT = """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could stand for a broader update this is pretty old. Added a ticket for later: https://linear.app/ionic-commerce/issue/ION-535/update-langchain-prompt

:return:
"""
query = query_input.query
split_query = query_input.split(",")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for various valid and invalid permutations? This is pretty complex so want to make sure we're covered

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for testing, mock the request or better yet split this into a helper and just test that.

split_query = query_input.split(",")
len4_query = split_query + [None] * (4 - len(split_query)) # pad with None

query, num_results, min_price, max_price, *rest = [ # *rest ignores extra values
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How certain are we that the given query_input matches the correct format?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its the format that is specified in the prompt. 😅

@stewartjarod stewartjarod merged commit edd0225 into main Jan 23, 2024
@stewartjarod stewartjarod deleted the gmkohler/ION-281 branch January 23, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants