krinya commited on
Commit
ec870c5
·
1 Parent(s): abf1abb

Fix create_quote.py path handling and add quote generation example

Browse files

- Fixed hardcoded path in create_quote.py to use dynamic path resolution
- Made the quote file creation more portable across different environments
- Added comprehensive quote generation example to Gradio UI
- Improved user experience with better example prompts

src/sales_assistant/agent_tools/create_quote.py CHANGED
@@ -140,8 +140,10 @@ def create_quote_file(quote: Quote, content: str) -> str:
140
  Returns:
141
  Path to the saved file
142
  """
143
- # Ensure the created_quotes directory exists
144
- quotes_dir = "/Users/krinya/sales_assistant_with_quote/src/sales_assistant/created_quotes"
 
 
145
  os.makedirs(quotes_dir, exist_ok=True)
146
 
147
  # Generate unique filename
 
140
  Returns:
141
  Path to the saved file
142
  """
143
+ # Get the directory of the current file and navigate to created_quotes
144
+ current_dir = os.path.dirname(os.path.abspath(__file__))
145
+ quotes_dir = os.path.join(current_dir, "..", "created_quotes")
146
+ quotes_dir = os.path.abspath(quotes_dir) # Resolve to absolute path
147
  os.makedirs(quotes_dir, exist_ok=True)
148
 
149
  # Generate unique filename
src/sales_assistant/ui_dashboard/gradio_app.py CHANGED
@@ -218,6 +218,7 @@ def create_gradio_interface():
218
  "Give me the cheapest Samsung 75 inch TV",
219
  "What categores of Sasmsung products do you have?",
220
  "Can you look for a mount or stand for a QH55C Samsung TV?",
 
221
  ],
222
  inputs=msg_input,
223
  label="Example Questions"
 
218
  "Give me the cheapest Samsung 75 inch TV",
219
  "What categores of Sasmsung products do you have?",
220
  "Can you look for a mount or stand for a QH55C Samsung TV?",
221
+ "Can you generate a quote for two QH55C Samsung TV and an Angekis Saber 4K+ (not white) in EUR for Customer name: John Doe, email: jd@gmailtest.com"
222
  ],
223
  inputs=msg_input,
224
  label="Example Questions"