Ionic Commerce tool for Haystack
Project description
Ionic Commerce tool for Haystack
Ionic Haystack provides an Agent Tool integration to Ionic Commerce. This tool will enable e-commerce for your agent , allowing your users to ask for product recommendations and purchase products through the agent chat interface.
Installation
You can install the package from PyPI using pip
:
python3 -m pip install ionic-haystack
or poetry
:
poetry add ionic-haystack
Usage
Get started quickly using Ionic Commerce with Haystack by creating an IonicShoppingTool and adding it to your agent's tools.
import os
from haystack.agents import Tool
from haystack.agents.conversational import ConversationalAgent
from haystack.agents.memory import ConversationMemory
from haystack.nodes import PromptNode
from ionic_haystack.prompt_templates import ionic_template
from ionic_haystack.tool import IonicShoppingTool
ionic_node = IonicShoppingTool(api_key="my_ionic_api_key")
ionic_tool = Tool(
name="Ionic",
pipeline_or_node=ionic_node,
description=ionic_template
)
memory = ConversationMemory()
prompt_node = PromptNode("gpt-3.5-turbo", api_key=os.getenv("OPENAI_API_KEY") , max_length=256, stop_words=["Observation:"])
agent = ConversationalAgent(prompt_node, tools=[ionic_tool], memory=memory, prompt_template="deepset/conversational-agent")
Examples
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ionic_haystack-0.1.6.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for ionic_haystack-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7089c04ad0edd27f542c8e18cece39c6ac7d49ab09f4d6105c24f62925eb3958 |
|
MD5 | 5e465bf9ab528c1747b14701da660e28 |
|
BLAKE2b-256 | 167601038b27e49852c1b8c91e3e889f372dd3bd6d90ff304ec9535817f07e10 |