codsworth
Advanced tools
| Metadata-Version: 2.4 | ||
| Name: codsworth | ||
| Version: 0.1.7 | ||
| Version: 0.1.8 | ||
| Summary: Your personal robotic butler | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/Bkiser2000/Codsworth |
+32
-30
@@ -251,3 +251,3 @@ import os | ||
| # --- Stock price query | ||
| # --- Stock price query | ||
| if any(word in user_input for word in stock_keywords) and ("price" in user_input or "quote" in user_input): | ||
@@ -257,3 +257,3 @@ if self.function_mappings and "stocks" in self.function_mappings: | ||
| # --- Crypto price query --- | ||
| # --- Crypto price query --- | ||
| if any(word in user_input for word in crypto_keywords) and ("price" in user_input or "quote" in user_input): | ||
@@ -263,3 +263,3 @@ if self.function_mappings and "crypto" in self.function_mappings: | ||
| # --- Stock/Crypto Predection Blocks | ||
| # --- Stock/Crypto Prediction Blocks --- | ||
| if any(pred_word in user_input for pred_word in prediction_keywords) and any(word in user_input for word in stock_keywords): | ||
@@ -281,31 +281,33 @@ if self.function_mappings and "stock_predict" in self.function_mappings: | ||
| # --- Other function mappings -- | ||
| if self.function_mappings and predicted_intent in self.function_mappings: | ||
| # Special handling for stock_predict and crypto_predict | ||
| if predicted_intent == "stock_predict": | ||
| # Try to extract symbol and days from user_input | ||
| days_ahead = self.extract_days(user_input) | ||
| symbol = None | ||
| for word in user_input.upper().split(): | ||
| if word in [k.upper() for k in STOCK_KEYWORDS]: | ||
| symbol = word | ||
| break | ||
| if symbol: | ||
| return self.function_mappings["stock_predict"](symbol=symbol, days_ahead=days_ahead) | ||
| else: | ||
| return self.function_mappings["stock_predict"](days_ahead=days_ahead) | ||
| elif predicted_intent == "crypto_predict": | ||
| days_ahead = self.extract_days(user_input) | ||
| symbol = None | ||
| for word in user_input.split(): | ||
| if word in CRYPTO_KEYWORDS: | ||
| symbol = word | ||
| break | ||
| if symbol: | ||
| return self.function_mappings["crypto_predict"](symbol=symbol, days_ahead=days_ahead) | ||
| if self.function_mappings and predicted_intent in self.function_mappings: | ||
| # Special handling for stock_predict and crypto_predict | ||
| if predicted_intent == "stock_predict": | ||
| days_ahead = self.extract_days(user_input) | ||
| symbol = None | ||
| for word in user_input.upper().split(): | ||
| if word in [k.upper() for k in STOCK_KEYWORDS]: | ||
| symbol = word | ||
| break | ||
| if symbol: | ||
| return self.function_mappings["stock_predict"](symbol=symbol, days_ahead=days_ahead) | ||
| else: | ||
| return self.function_mappings["stock_predict"](days_ahead=days_ahead) | ||
| elif predicted_intent == "crypto_predict": | ||
| days_ahead = self.extract_days(user_input) | ||
| symbol = None | ||
| for word in user_input.split(): | ||
| if word in CRYPTO_KEYWORDS: | ||
| symbol = word | ||
| break | ||
| if symbol: | ||
| return self.function_mappings["crypto_predict"](symbol=symbol, days_ahead=days_ahead) | ||
| else: | ||
| return self.function_mappings["crypto_predict"](days_ahead=days_ahead) | ||
| else: | ||
| return self.function_mappings["crypto_predict"](days_ahead=days_ahead) | ||
| else: | ||
| return self.function_mappings[predicted_intent](entities=entities) | ||
| return self.function_mappings[predicted_intent](entities=entities) | ||
| # Only use canned response if there is no function mapping | ||
| if predicted_intent in self.intents_responses and self.intents_responses[predicted_intent]: | ||
| return random.choice(self.intents_responses[predicted_intent]) | ||
| # --- Last resort --- | ||
@@ -312,0 +314,0 @@ |
+1
-1
| Metadata-Version: 2.4 | ||
| Name: codsworth | ||
| Version: 0.1.7 | ||
| Version: 0.1.8 | ||
| Summary: Your personal robotic butler | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/Bkiser2000/Codsworth |
+1
-1
| [metadata] | ||
| name = codsworth | ||
| version = 0.1.7 | ||
| version = 0.1.8 | ||
| description = Your personal robotic butler | ||
@@ -5,0 +5,0 @@ long_description = file: README.md |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
548386
34.65%679
0.15%