ai-parrot 0.8.3__cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ai-parrot might be problematic. Click here for more details.

Files changed (128) hide show
  1. ai_parrot-0.8.3.dist-info/LICENSE +21 -0
  2. ai_parrot-0.8.3.dist-info/METADATA +306 -0
  3. ai_parrot-0.8.3.dist-info/RECORD +128 -0
  4. ai_parrot-0.8.3.dist-info/WHEEL +6 -0
  5. ai_parrot-0.8.3.dist-info/top_level.txt +2 -0
  6. parrot/__init__.py +30 -0
  7. parrot/bots/__init__.py +5 -0
  8. parrot/bots/abstract.py +1115 -0
  9. parrot/bots/agent.py +492 -0
  10. parrot/bots/basic.py +9 -0
  11. parrot/bots/bose.py +17 -0
  12. parrot/bots/chatbot.py +271 -0
  13. parrot/bots/cody.py +17 -0
  14. parrot/bots/copilot.py +117 -0
  15. parrot/bots/data.py +730 -0
  16. parrot/bots/dataframe.py +103 -0
  17. parrot/bots/hrbot.py +15 -0
  18. parrot/bots/interfaces/__init__.py +1 -0
  19. parrot/bots/interfaces/retrievers.py +12 -0
  20. parrot/bots/notebook.py +619 -0
  21. parrot/bots/odoo.py +17 -0
  22. parrot/bots/prompts/__init__.py +41 -0
  23. parrot/bots/prompts/agents.py +91 -0
  24. parrot/bots/prompts/data.py +214 -0
  25. parrot/bots/retrievals/__init__.py +1 -0
  26. parrot/bots/retrievals/constitutional.py +19 -0
  27. parrot/bots/retrievals/multi.py +122 -0
  28. parrot/bots/retrievals/retrieval.py +610 -0
  29. parrot/bots/tools/__init__.py +7 -0
  30. parrot/bots/tools/eda.py +325 -0
  31. parrot/bots/tools/pdf.py +50 -0
  32. parrot/bots/tools/plot.py +48 -0
  33. parrot/bots/troc.py +16 -0
  34. parrot/conf.py +170 -0
  35. parrot/crew/__init__.py +3 -0
  36. parrot/crew/tools/__init__.py +22 -0
  37. parrot/crew/tools/bing.py +13 -0
  38. parrot/crew/tools/config.py +43 -0
  39. parrot/crew/tools/duckgo.py +62 -0
  40. parrot/crew/tools/file.py +24 -0
  41. parrot/crew/tools/google.py +168 -0
  42. parrot/crew/tools/gtrends.py +16 -0
  43. parrot/crew/tools/md2pdf.py +25 -0
  44. parrot/crew/tools/rag.py +42 -0
  45. parrot/crew/tools/search.py +32 -0
  46. parrot/crew/tools/url.py +21 -0
  47. parrot/exceptions.cpython-311-x86_64-linux-gnu.so +0 -0
  48. parrot/handlers/__init__.py +4 -0
  49. parrot/handlers/agents.py +292 -0
  50. parrot/handlers/bots.py +196 -0
  51. parrot/handlers/chat.py +192 -0
  52. parrot/interfaces/__init__.py +6 -0
  53. parrot/interfaces/database.py +27 -0
  54. parrot/interfaces/http.py +805 -0
  55. parrot/interfaces/images/__init__.py +0 -0
  56. parrot/interfaces/images/plugins/__init__.py +18 -0
  57. parrot/interfaces/images/plugins/abstract.py +58 -0
  58. parrot/interfaces/images/plugins/exif.py +709 -0
  59. parrot/interfaces/images/plugins/hash.py +52 -0
  60. parrot/interfaces/images/plugins/vision.py +104 -0
  61. parrot/interfaces/images/plugins/yolo.py +66 -0
  62. parrot/interfaces/images/plugins/zerodetect.py +197 -0
  63. parrot/llms/__init__.py +1 -0
  64. parrot/llms/abstract.py +69 -0
  65. parrot/llms/anthropic.py +58 -0
  66. parrot/llms/gemma.py +15 -0
  67. parrot/llms/google.py +44 -0
  68. parrot/llms/groq.py +67 -0
  69. parrot/llms/hf.py +45 -0
  70. parrot/llms/openai.py +61 -0
  71. parrot/llms/pipes.py +114 -0
  72. parrot/llms/vertex.py +89 -0
  73. parrot/loaders/__init__.py +9 -0
  74. parrot/loaders/abstract.py +628 -0
  75. parrot/loaders/files/__init__.py +0 -0
  76. parrot/loaders/files/abstract.py +39 -0
  77. parrot/loaders/files/text.py +63 -0
  78. parrot/loaders/txt.py +26 -0
  79. parrot/manager.py +333 -0
  80. parrot/models.py +504 -0
  81. parrot/py.typed +0 -0
  82. parrot/stores/__init__.py +11 -0
  83. parrot/stores/abstract.py +248 -0
  84. parrot/stores/chroma.py +188 -0
  85. parrot/stores/duck.py +162 -0
  86. parrot/stores/embeddings/__init__.py +10 -0
  87. parrot/stores/embeddings/abstract.py +46 -0
  88. parrot/stores/embeddings/base.py +52 -0
  89. parrot/stores/embeddings/bge.py +20 -0
  90. parrot/stores/embeddings/fastembed.py +17 -0
  91. parrot/stores/embeddings/google.py +18 -0
  92. parrot/stores/embeddings/huggingface.py +20 -0
  93. parrot/stores/embeddings/ollama.py +14 -0
  94. parrot/stores/embeddings/openai.py +26 -0
  95. parrot/stores/embeddings/transformers.py +21 -0
  96. parrot/stores/embeddings/vertexai.py +17 -0
  97. parrot/stores/empty.py +10 -0
  98. parrot/stores/faiss.py +160 -0
  99. parrot/stores/milvus.py +397 -0
  100. parrot/stores/postgres.py +653 -0
  101. parrot/stores/qdrant.py +170 -0
  102. parrot/tools/__init__.py +23 -0
  103. parrot/tools/abstract.py +68 -0
  104. parrot/tools/asknews.py +33 -0
  105. parrot/tools/basic.py +51 -0
  106. parrot/tools/bby.py +359 -0
  107. parrot/tools/bing.py +13 -0
  108. parrot/tools/docx.py +343 -0
  109. parrot/tools/duck.py +62 -0
  110. parrot/tools/execute.py +56 -0
  111. parrot/tools/gamma.py +28 -0
  112. parrot/tools/google.py +170 -0
  113. parrot/tools/gvoice.py +301 -0
  114. parrot/tools/results.py +278 -0
  115. parrot/tools/stack.py +27 -0
  116. parrot/tools/weather.py +70 -0
  117. parrot/tools/wikipedia.py +58 -0
  118. parrot/tools/zipcode.py +198 -0
  119. parrot/utils/__init__.py +2 -0
  120. parrot/utils/parsers/__init__.py +5 -0
  121. parrot/utils/parsers/toml.cpython-311-x86_64-linux-gnu.so +0 -0
  122. parrot/utils/toml.py +11 -0
  123. parrot/utils/types.cpython-311-x86_64-linux-gnu.so +0 -0
  124. parrot/utils/uv.py +11 -0
  125. parrot/version.py +10 -0
  126. resources/users/__init__.py +5 -0
  127. resources/users/handlers.py +13 -0
  128. resources/users/models.py +205 -0
@@ -0,0 +1,103 @@
1
+ from typing import Union
2
+ import pandas as pd
3
+ from langchain_experimental.tools.python.tool import PythonAstREPLTool
4
+ from .base import BaseAgent
5
+
6
+
7
+ BASEPROMPT = """
8
+ Your name is {name}, You are a helpful assistant built to provide comprehensive guidance and support on data calculations and various aspects of payroll, such as earnings, deductions, salary information, and payroll tax. The goal is to ensure accurate, timely, and compliant payroll processing.
9
+
10
+ **Your Capabilities:**
11
+
12
+ 1. **Earnings Calculation:**
13
+ - Calculate regular earnings based on hourly rates or salaries.
14
+ - Handle overtime calculations, including differentials and double-time as needed.
15
+ - Include bonuses, commissions, and other incentive earnings.
16
+
17
+ 2. **Deductions:**
18
+ - Calculate mandatory deductions including federal, state, and local taxes.
19
+ - Handle other withholdings such as Social Security, Medicare, disability insurance, and unemployment insurance.
20
+ - Process voluntary deductions (e.g., health insurance premiums, retirement plan contributions, charitable donations).
21
+
22
+ 3. **Salary Information:**
23
+ - Provide gross and net salary breakdowns.
24
+ - Assist in setting up and adjusting salary structures.
25
+ - Manage payroll for part-time, full-time, and contract employees.
26
+
27
+ These keywords must never be translated and transformed:
28
+ - Action:
29
+ - Thought:
30
+ - Action Input:
31
+ because they are part of the thinking process instead of the output.
32
+
33
+ You are working with {num_dfs} pandas dataframes in Python named df1, df2, etc. You should use the tools below to answer the question posed to you:
34
+
35
+ - python_repl_ast: A Python shell. Use this to execute python commands. Input should be a valid python command. When using this tool, sometimes output is abbreviated - make sure it does not look abbreviated before using it in your answer.
36
+ - {tools}
37
+
38
+ To use a tool, please use the following format:
39
+
40
+ ```
41
+ Question: the input question you must answer.
42
+ Thought: You should always think about what to do, don't try to reason out the answer on your own.
43
+ Action: the action to take, should be one of [python_repl_ast,{tool_names}] if using a tool, otherwise answer on your own.
44
+ Action Input: the input to the action.
45
+ Observation: the result of the action.
46
+ ... (this Thought/Action/Action Input/Observation can repeat N times)
47
+ Final Thought: I now know the final answer.
48
+ Final Answer: the final answer to the original input question.
49
+ ```
50
+
51
+
52
+ ```
53
+ This is the result of `print(df1.head())` for each dataframe:
54
+ {dfs_head}
55
+ ```
56
+
57
+ Begin!
58
+
59
+ Question: {input}
60
+ {agent_scratchpad}
61
+ """
62
+
63
+
64
+ class DataFrameAgent(BaseAgent):
65
+ """Dataframe Agent.
66
+
67
+ This is the Pandas Agent Chatbot.
68
+ """
69
+ def __init__(
70
+ self,
71
+ name: str = 'Agent',
72
+ llm: str = 'vertexai',
73
+ tools: list = None,
74
+ df: Union[list[pd.DataFrame], pd.DataFrame] = None,
75
+ prompt_template: str = None,
76
+ **kwargs
77
+ ):
78
+ super().__init__(name, llm, tools, prompt_template, **kwargs)
79
+ for _df in df if isinstance(df, list) else [df]:
80
+ if not isinstance(_df, pd.DataFrame):
81
+ raise ValueError(
82
+ f"Expected pandas DataFrame, got {type(_df)}"
83
+ )
84
+ self.df = df
85
+ df_locals = {}
86
+ dfs_head = ""
87
+ num_dfs = 1
88
+ if isinstance(df, pd.DataFrame):
89
+ df = [df]
90
+ num_dfs = len(df)
91
+ for i, dataframe in enumerate(df):
92
+ df_locals[f"df{i + 1}"] = dataframe
93
+ dfs_head += (
94
+ f"\n\n- This is the result of `print(df{i + 1}.head())`:\n"
95
+ + dataframe.head().to_markdown() + "\n"
96
+ )
97
+ prompt_template = BASEPROMPT
98
+ self.tools = [PythonAstREPLTool(locals=df_locals)] + list(tools)
99
+ self.prompt = self.get_prompt(
100
+ prompt_template,
101
+ num_dfs=num_dfs,
102
+ dfs_head=dfs_head
103
+ )
parrot/bots/hrbot.py ADDED
@@ -0,0 +1,15 @@
1
+ from .chatbot import Chatbot
2
+
3
+ class HRAgent(Chatbot):
4
+ """Represents an Human Resources agent in Navigator.
5
+
6
+ Each agent has a name, a role, a goal, a backstory,
7
+ and an optional language model (llm).
8
+ """
9
+ name: str = 'TROCers'
10
+ company: str = 'T-ROC Global'
11
+ company_website: str = 'https://www.trocglobal.com'
12
+ contact_information = 'communications@trocglobal.com'
13
+ contact_form = 'https://www.surveymonkey.com/r/TROC_Suggestion_Box'
14
+ role: str = 'Human Resources Assistant'
15
+ goal = 'Bring useful information to employees'
@@ -0,0 +1 @@
1
+ from .retrievers import EmptyRetriever
@@ -0,0 +1,12 @@
1
+ from langchain_core.retrievers import BaseRetriever
2
+ from langchain_core.vectorstores import VectorStoreRetriever
3
+
4
+
5
+ class EmptyRetriever(BaseRetriever):
6
+ """Return a Retriever with No results.
7
+ """
8
+ async def aget_relevant_documents(self, query: str):
9
+ return []
10
+
11
+ def _get_relevant_documents(self, query: str):
12
+ return []