Initializer for Xurpas Xeed ChatBot for the frappe bench
Project description
XeedChatBot
How to Use
- Load the dataframe
- initialize the XeedChatBot Class
XeedChatBot
Initializes the Chat Bot
Args
df: Pandas DataFrame object of the data to be analyzed. Also accepts a list of DataFrame
Only supports .csv, .xlsx, .parquet, and .orc file formats.
db: Database Object that can be analyzed. If df is used, db should be empty
llm: Optional. Name of the Large Language Model to be used.
prompt: Optional. Instructions for the model.
Returns
Chatbot Agent
Sample Usage using pandas DataFrame
import os
import pandas as pd
from xeedchatbot import XeedChatBot
#set the API KEY
os.environ["OPENAI_API_KEY"] = OPEN_API_KEY
df = pd.read_csv('sample_data/financial_data.csv')
prompt = f"You are an expert on the company's finances. By default the company you will provide information for is Xurpas.\
Please make sure you complete the objective above with the following rules:\
1/ Your job is to first breakdown the topic into relevant questions for understanding the topic in detail. You should have at max only 3 questions not more than that, in case there are more than 3 questions consider only the first 3 questions and ignore the others.\
2/ You should use finance_tool to get more information about the topic. You are allowed to use the search tool only 3 times in this process.\
3/ If asked for multiple items, query them one by one using the tools provided.\
4/ If not asked for a specific time period, assume the year 2024.\
5/ Aggregate all the answers that you can get on this topic.\
6/ Ouput DataFrame data as an HTML table."
chatbot = XeedChatBot(df=df, prompt=prompt)
agent = chatbot.initialize_chatbot()
msg = agent.invoke("What is the EBITDA for Xurpas for the year 2024")
print(msg['output'])
*The EBITDA for Xurpas is $50 million.*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xeedchatbot-0.0.1.tar.gz.
File metadata
- Download URL: xeedchatbot-0.0.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e20b2c5f58043d0914e5c7781e797598e34c22bb17baf8d2232630f727b02017
|
|
| MD5 |
5da187dbbfc6768e44fe2196ddc88e06
|
|
| BLAKE2b-256 |
786a76ab2aa6f94cb2323fa557576297e1e5cb81dcb35de9fe7919f4a277e833
|
File details
Details for the file xeedchatbot-0.0.1-py3-none-any.whl.
File metadata
- Download URL: xeedchatbot-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27c29933e12ce0b06804bc469d5efc55fd359e3d951ef8a1e4b01337a831e293
|
|
| MD5 |
f2208d573954726607887e22c2c95818
|
|
| BLAKE2b-256 |
94a4aacbfc52ef2acbcea0fc15233996470f32cfc5a51cdaf9d9a699c870118a
|