PraisonAI 1.0.8__cp312-cp312-manylinux_2_39_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 PraisonAI might be problematic. Click here for more details.

Files changed (56) hide show
  1. praisonai/__init__.py +6 -0
  2. praisonai/__main__.py +10 -0
  3. praisonai/agents_generator.py +474 -0
  4. praisonai/api/call.py +292 -0
  5. praisonai/auto.py +226 -0
  6. praisonai/chainlit_ui.py +304 -0
  7. praisonai/cli.py +506 -0
  8. praisonai/deploy.py +138 -0
  9. praisonai/inbuilt_tools/__init__.py +24 -0
  10. praisonai/inbuilt_tools/autogen_tools.py +117 -0
  11. praisonai/inc/__init__.py +2 -0
  12. praisonai/inc/config.py +96 -0
  13. praisonai/inc/models.py +128 -0
  14. praisonai/public/android-chrome-192x192.png +0 -0
  15. praisonai/public/android-chrome-512x512.png +0 -0
  16. praisonai/public/apple-touch-icon.png +0 -0
  17. praisonai/public/fantasy.svg +3 -0
  18. praisonai/public/favicon-16x16.png +0 -0
  19. praisonai/public/favicon-32x32.png +0 -0
  20. praisonai/public/favicon.ico +0 -0
  21. praisonai/public/game.svg +3 -0
  22. praisonai/public/logo_dark.png +0 -0
  23. praisonai/public/logo_light.png +0 -0
  24. praisonai/public/movie.svg +3 -0
  25. praisonai/public/thriller.svg +3 -0
  26. praisonai/setup/__init__.py +1 -0
  27. praisonai/setup/build.py +21 -0
  28. praisonai/setup/config.yaml +60 -0
  29. praisonai/setup/post_install.py +23 -0
  30. praisonai/setup/setup_conda_env.py +25 -0
  31. praisonai/setup/setup_conda_env.sh +72 -0
  32. praisonai/setup.py +16 -0
  33. praisonai/test.py +105 -0
  34. praisonai/train.py +276 -0
  35. praisonai/ui/README.md +21 -0
  36. praisonai/ui/chat.py +387 -0
  37. praisonai/ui/code.py +440 -0
  38. praisonai/ui/context.py +283 -0
  39. praisonai/ui/db.py +242 -0
  40. praisonai/ui/public/fantasy.svg +3 -0
  41. praisonai/ui/public/game.svg +3 -0
  42. praisonai/ui/public/logo_dark.png +0 -0
  43. praisonai/ui/public/logo_light.png +0 -0
  44. praisonai/ui/public/movie.svg +3 -0
  45. praisonai/ui/public/thriller.svg +3 -0
  46. praisonai/ui/realtime.py +421 -0
  47. praisonai/ui/realtimeclient/__init__.py +653 -0
  48. praisonai/ui/realtimeclient/realtimedocs.txt +1484 -0
  49. praisonai/ui/realtimeclient/tools.py +236 -0
  50. praisonai/ui/sql_alchemy.py +706 -0
  51. praisonai/version.py +1 -0
  52. praisonai-1.0.8.dist-info/LICENSE +20 -0
  53. praisonai-1.0.8.dist-info/METADATA +496 -0
  54. praisonai-1.0.8.dist-info/RECORD +56 -0
  55. praisonai-1.0.8.dist-info/WHEEL +4 -0
  56. praisonai-1.0.8.dist-info/entry_points.txt +5 -0
praisonai/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ # Disable OpenTelemetry SDK
2
+ import os
3
+ os.environ["OTEL_SDK_DISABLED"] = "true"
4
+ os.environ["EC_TELEMETRY"] = "false"
5
+ from .cli import PraisonAI
6
+ from .version import __version__
praisonai/__main__.py ADDED
@@ -0,0 +1,10 @@
1
+ # __main__.py
2
+
3
+ from .cli import PraisonAI
4
+
5
+ def main():
6
+ praison_ai = PraisonAI()
7
+ praison_ai.main()
8
+
9
+ if __name__ == "__main__":
10
+ main()
@@ -0,0 +1,474 @@
1
+ # praisonai/agents_generator.py
2
+
3
+ import sys
4
+ from .version import __version__
5
+ import yaml, os
6
+ from rich import print
7
+ from dotenv import load_dotenv
8
+ from .auto import AutoGenerator
9
+ from .inbuilt_tools import *
10
+ from .inc import PraisonAIModel
11
+ import inspect
12
+ from pathlib import Path
13
+ import importlib
14
+ import importlib.util
15
+ import os
16
+ import logging
17
+
18
+ # Framework-specific imports with availability checks
19
+ CREWAI_AVAILABLE = False
20
+ AUTOGEN_AVAILABLE = False
21
+ PRAISONAI_TOOLS_AVAILABLE = False
22
+ AGENTOPS_AVAILABLE = False
23
+
24
+ try:
25
+ from crewai import Agent, Task, Crew
26
+ from crewai.telemetry import Telemetry
27
+ CREWAI_AVAILABLE = True
28
+ except ImportError:
29
+ pass
30
+
31
+ try:
32
+ import autogen
33
+ AUTOGEN_AVAILABLE = True
34
+ except ImportError:
35
+ pass
36
+
37
+ try:
38
+ import agentops
39
+ AGENTOPS_AVAILABLE = True
40
+ except ImportError:
41
+ pass
42
+
43
+ # Only try to import praisonai_tools if either CrewAI or AutoGen is available
44
+ if CREWAI_AVAILABLE or AUTOGEN_AVAILABLE:
45
+ try:
46
+ from praisonai_tools import (
47
+ CodeDocsSearchTool, CSVSearchTool, DirectorySearchTool, DOCXSearchTool, DirectoryReadTool,
48
+ FileReadTool, TXTSearchTool, JSONSearchTool, MDXSearchTool, PDFSearchTool, RagTool,
49
+ ScrapeElementFromWebsiteTool, ScrapeWebsiteTool, WebsiteSearchTool, XMLSearchTool,
50
+ YoutubeChannelSearchTool, YoutubeVideoSearchTool, BaseTool
51
+ )
52
+ PRAISONAI_TOOLS_AVAILABLE = True
53
+ except ImportError:
54
+ # If import fails, define BaseTool as a simple base class
55
+ class BaseTool:
56
+ pass
57
+
58
+ os.environ["OTEL_SDK_DISABLED"] = "true"
59
+
60
+ def noop(*args, **kwargs):
61
+ pass
62
+
63
+ def disable_crewai_telemetry():
64
+ if CREWAI_AVAILABLE:
65
+ for attr in dir(Telemetry):
66
+ if callable(getattr(Telemetry, attr)) and not attr.startswith("__"):
67
+ setattr(Telemetry, attr, noop)
68
+
69
+ # Only disable telemetry if CrewAI is available
70
+ if CREWAI_AVAILABLE:
71
+ disable_crewai_telemetry()
72
+
73
+ class AgentsGenerator:
74
+ def __init__(self, agent_file, framework, config_list, log_level=None, agent_callback=None, task_callback=None, agent_yaml=None, tools=None):
75
+ """
76
+ Initialize the AgentsGenerator object.
77
+
78
+ Parameters:
79
+ agent_file (str): The path to the agent file.
80
+ framework (str): The framework to be used for the agents.
81
+ config_list (list): A list of configurations for the agents.
82
+ log_level (int, optional): The logging level to use. Defaults to logging.INFO.
83
+ agent_callback (callable, optional): A callback function to be executed after each agent step.
84
+ task_callback (callable, optional): A callback function to be executed after each tool run.
85
+ agent_yaml (str, optional): The content of the YAML file. Defaults to None.
86
+ tools (dict, optional): A dictionary containing the tools to be used for the agents. Defaults to None.
87
+
88
+ Attributes:
89
+ agent_file (str): The path to the agent file.
90
+ framework (str): The framework to be used for the agents.
91
+ config_list (list): A list of configurations for the agents.
92
+ log_level (int): The logging level to use.
93
+ agent_callback (callable, optional): A callback function to be executed after each agent step.
94
+ task_callback (callable, optional): A callback function to be executed after each tool run.
95
+ tools (dict): A dictionary containing the tools to be used for the agents.
96
+ """
97
+ self.agent_file = agent_file
98
+ self.framework = framework
99
+ self.config_list = config_list
100
+ self.log_level = log_level
101
+ self.agent_callback = agent_callback
102
+ self.task_callback = task_callback
103
+ self.agent_yaml = agent_yaml
104
+ self.tools = tools or [] # Store tool class names as a list
105
+ self.log_level = log_level or logging.getLogger().getEffectiveLevel()
106
+ if self.log_level == logging.NOTSET:
107
+ self.log_level = os.environ.get('LOGLEVEL', 'INFO').upper()
108
+
109
+ logging.basicConfig(level=self.log_level, format='%(asctime)s - %(levelname)s - %(message)s')
110
+ self.logger = logging.getLogger(__name__)
111
+ self.logger.setLevel(self.log_level)
112
+
113
+ # Validate framework availability
114
+ if framework == "crewai" and not CREWAI_AVAILABLE:
115
+ raise ImportError("CrewAI is not installed. Please install it with 'pip install praisonai[crewai]'")
116
+ elif framework == "autogen" and not AUTOGEN_AVAILABLE:
117
+ raise ImportError("AutoGen is not installed. Please install it with 'pip install praisonai[autogen]'")
118
+
119
+ def is_function_or_decorated(self, obj):
120
+ """
121
+ Checks if the given object is a function or has a __call__ method.
122
+
123
+ Parameters:
124
+ obj (object): The object to be checked.
125
+
126
+ Returns:
127
+ bool: True if the object is a function or has a __call__ method, False otherwise.
128
+ """
129
+ return inspect.isfunction(obj) or hasattr(obj, '__call__')
130
+
131
+ def load_tools_from_module(self, module_path):
132
+ """
133
+ Loads tools from a specified module path.
134
+
135
+ Parameters:
136
+ module_path (str): The path to the module containing the tools.
137
+
138
+ Returns:
139
+ dict: A dictionary containing the names of the tools as keys and the corresponding functions or objects as values.
140
+
141
+ Raises:
142
+ FileNotFoundError: If the specified module path does not exist.
143
+ """
144
+ spec = importlib.util.spec_from_file_location("tools_module", module_path)
145
+ module = importlib.util.module_from_spec(spec)
146
+ spec.loader.exec_module(module)
147
+ return {name: obj for name, obj in inspect.getmembers(module, self.is_function_or_decorated)}
148
+
149
+ def load_tools_from_module_class(self, module_path):
150
+ """
151
+ Loads tools from a specified module path containing classes that inherit from BaseTool
152
+ or are part of langchain_community.tools package.
153
+ """
154
+ spec = importlib.util.spec_from_file_location("tools_module", module_path)
155
+ module = importlib.util.module_from_spec(spec)
156
+ try:
157
+ spec.loader.exec_module(module)
158
+ return {name: obj() for name, obj in inspect.getmembers(module,
159
+ lambda x: inspect.isclass(x) and (
160
+ x.__module__.startswith('langchain_community.tools') or
161
+ (PRAISONAI_TOOLS_AVAILABLE and issubclass(x, BaseTool))
162
+ ) and x is not BaseTool)}
163
+ except ImportError as e:
164
+ self.logger.warning(f"Error loading tools from {module_path}: {e}")
165
+ return {}
166
+
167
+ def load_tools_from_package(self, package_path):
168
+ """
169
+ Loads tools from a specified package path containing modules with functions or classes.
170
+
171
+ Parameters:
172
+ package_path (str): The path to the package containing the tools.
173
+
174
+ Returns:
175
+ dict: A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.
176
+
177
+ Raises:
178
+ FileNotFoundError: If the specified package path does not exist.
179
+
180
+ This function iterates through all the .py files in the specified package path, excluding those that start with "__". For each file, it imports the corresponding module and checks if it contains any functions or classes that can be loaded as tools. The function then returns a dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.
181
+ """
182
+ tools_dict = {}
183
+ for module_file in os.listdir(package_path):
184
+ if module_file.endswith('.py') and not module_file.startswith('__'):
185
+ module_name = f"{package_path.name}.{module_file[:-3]}" # Remove .py for import
186
+ module = importlib.import_module(module_name)
187
+ for name, obj in inspect.getmembers(module, self.is_function_or_decorated):
188
+ tools_dict[name] = obj
189
+ return tools_dict
190
+
191
+ def generate_crew_and_kickoff(self):
192
+ """
193
+ Generates a crew of agents and initiates tasks based on the provided configuration.
194
+
195
+ Parameters:
196
+ agent_file (str): The path to the agent file.
197
+ framework (str): The framework to be used for the agents.
198
+ config_list (list): A list of configurations for the agents.
199
+
200
+ Returns:
201
+ str: The output of the tasks performed by the crew of agents.
202
+
203
+ Raises:
204
+ FileNotFoundError: If the specified agent file does not exist.
205
+
206
+ This function first loads the agent configuration from the specified file. It then initializes the tools required for the agents based on the specified framework. If the specified framework is "autogen", it loads the LLM configuration dynamically and creates an AssistantAgent for each role in the configuration. It then adds tools to the agents if specified in the configuration. Finally, it prepares tasks for the agents based on the configuration and initiates the tasks using the crew of agents. If the specified framework is not "autogen", it creates a crew of agents and initiates tasks based on the configuration.
207
+ """
208
+ if self.agent_yaml:
209
+ config = yaml.safe_load(self.agent_yaml)
210
+ else:
211
+ if self.agent_file == '/app/api:app' or self.agent_file == 'api:app':
212
+ self.agent_file = 'agents.yaml'
213
+ try:
214
+ with open(self.agent_file, 'r') as f:
215
+ config = yaml.safe_load(f)
216
+ except FileNotFoundError:
217
+ print(f"File not found: {self.agent_file}")
218
+ return
219
+
220
+ topic = config['topic']
221
+ tools_dict = {}
222
+
223
+ # Only try to use praisonai_tools if it's available and needed
224
+ if PRAISONAI_TOOLS_AVAILABLE and (CREWAI_AVAILABLE or AUTOGEN_AVAILABLE):
225
+ tools_dict = {
226
+ 'CodeDocsSearchTool': CodeDocsSearchTool(),
227
+ 'CSVSearchTool': CSVSearchTool(),
228
+ 'DirectorySearchTool': DirectorySearchTool(),
229
+ 'DOCXSearchTool': DOCXSearchTool(),
230
+ 'DirectoryReadTool': DirectoryReadTool(),
231
+ 'FileReadTool': FileReadTool(),
232
+ 'TXTSearchTool': TXTSearchTool(),
233
+ 'JSONSearchTool': JSONSearchTool(),
234
+ 'MDXSearchTool': MDXSearchTool(),
235
+ 'PDFSearchTool': PDFSearchTool(),
236
+ 'RagTool': RagTool(),
237
+ 'ScrapeElementFromWebsiteTool': ScrapeElementFromWebsiteTool(),
238
+ 'ScrapeWebsiteTool': ScrapeWebsiteTool(),
239
+ 'WebsiteSearchTool': WebsiteSearchTool(),
240
+ 'XMLSearchTool': XMLSearchTool(),
241
+ 'YoutubeChannelSearchTool': YoutubeChannelSearchTool(),
242
+ 'YoutubeVideoSearchTool': YoutubeVideoSearchTool(),
243
+ }
244
+
245
+ # Add tools from class names
246
+ for tool_class in self.tools:
247
+ if isinstance(tool_class, type) and issubclass(tool_class, BaseTool):
248
+ tool_name = tool_class.__name__
249
+ tools_dict[tool_name] = tool_class()
250
+ self.logger.debug(f"Added tool: {tool_name}")
251
+
252
+ root_directory = os.getcwd()
253
+ tools_py_path = os.path.join(root_directory, 'tools.py')
254
+ tools_dir_path = Path(root_directory) / 'tools'
255
+
256
+ if os.path.isfile(tools_py_path):
257
+ tools_dict.update(self.load_tools_from_module_class(tools_py_path))
258
+ self.logger.debug("tools.py exists in the root directory. Loading tools.py and skipping tools folder.")
259
+ elif tools_dir_path.is_dir():
260
+ tools_dict.update(self.load_tools_from_module_class(tools_dir_path))
261
+ self.logger.debug("tools folder exists in the root directory")
262
+
263
+ framework = self.framework or config.get('framework')
264
+
265
+ if framework == "autogen":
266
+ if not AUTOGEN_AVAILABLE:
267
+ raise ImportError("AutoGen is not installed. Please install it with 'pip install praisonai[autogen]'")
268
+ if AGENTOPS_AVAILABLE:
269
+ agentops.init(os.environ.get("AGENTOPS_API_KEY"), tags=["autogen"])
270
+ return self._run_autogen(config, topic, tools_dict)
271
+ else: # framework=crewai
272
+ if not CREWAI_AVAILABLE:
273
+ raise ImportError("CrewAI is not installed. Please install it with 'pip install praisonai[crewai]'")
274
+ if AGENTOPS_AVAILABLE:
275
+ agentops.init(os.environ.get("AGENTOPS_API_KEY"), tags=["crewai"])
276
+ return self._run_crewai(config, topic, tools_dict)
277
+
278
+ def _run_autogen(self, config, topic, tools_dict):
279
+ """
280
+ Run agents using the AutoGen framework.
281
+
282
+ Args:
283
+ config (dict): Configuration dictionary
284
+ topic (str): The topic to process
285
+ tools_dict (dict): Dictionary of available tools
286
+
287
+ Returns:
288
+ str: Result of the agent interactions
289
+ """
290
+ llm_config = {"config_list": self.config_list}
291
+
292
+ # Set up user proxy agent
293
+ user_proxy = autogen.UserProxyAgent(
294
+ name="User",
295
+ human_input_mode="NEVER",
296
+ is_termination_msg=lambda x: (x.get("content") or "").rstrip().rstrip(".").lower().endswith("terminate") or "TERMINATE" in (x.get("content") or ""),
297
+ code_execution_config={
298
+ "work_dir": "coding",
299
+ "use_docker": False,
300
+ }
301
+ )
302
+
303
+ agents = {}
304
+ tasks = []
305
+
306
+ # Create agents and tasks from config
307
+ for role, details in config['roles'].items():
308
+ agent_name = details['role'].format(topic=topic).replace("{topic}", topic)
309
+ agent_goal = details['goal'].format(topic=topic)
310
+
311
+ # Create AutoGen assistant agent
312
+ agents[role] = autogen.AssistantAgent(
313
+ name=agent_name,
314
+ llm_config=llm_config,
315
+ system_message=details['backstory'].format(topic=topic) +
316
+ ". Must Reply \"TERMINATE\" in the end when everything is done.",
317
+ )
318
+
319
+ # Add tools to agent if specified
320
+ for tool in details.get('tools', []):
321
+ if tool in tools_dict:
322
+ try:
323
+ tool_class = globals()[f'autogen_{type(tools_dict[tool]).__name__}']
324
+ self.logger.debug(f"Found {tool_class.__name__} for {tool}")
325
+ tool_class(agents[role], user_proxy)
326
+ except KeyError:
327
+ self.logger.warning(f"Warning: autogen_{type(tools_dict[tool]).__name__} function not found. Skipping this tool.")
328
+ continue
329
+
330
+ # Prepare tasks
331
+ for task_name, task_details in details.get('tasks', {}).items():
332
+ description_filled = task_details['description'].format(topic=topic)
333
+ expected_output_filled = task_details['expected_output'].format(topic=topic)
334
+
335
+ chat_task = {
336
+ "recipient": agents[role],
337
+ "message": description_filled,
338
+ "summary_method": "last_msg",
339
+ }
340
+ tasks.append(chat_task)
341
+
342
+ # Execute tasks
343
+ response = user_proxy.initiate_chats(tasks)
344
+ result = "### Output ###\n" + response[-1].summary if hasattr(response[-1], 'summary') else ""
345
+
346
+ if AGENTOPS_AVAILABLE:
347
+ agentops.end_session("Success")
348
+
349
+ return result
350
+
351
+ def _run_crewai(self, config, topic, tools_dict):
352
+ """
353
+ Run agents using the CrewAI framework.
354
+
355
+ Args:
356
+ config (dict): Configuration dictionary
357
+ topic (str): The topic to process
358
+ tools_dict (dict): Dictionary of available tools
359
+
360
+ Returns:
361
+ str: Result of the agent interactions
362
+ """
363
+ agents = {}
364
+ tasks = []
365
+ tasks_dict = {}
366
+
367
+ # Create agents from config
368
+ for role, details in config['roles'].items():
369
+ role_filled = details['role'].format(topic=topic)
370
+ goal_filled = details['goal'].format(topic=topic)
371
+ backstory_filled = details['backstory'].format(topic=topic)
372
+
373
+ # Get agent tools
374
+ agent_tools = [tools_dict[tool] for tool in details.get('tools', [])
375
+ if tool in tools_dict]
376
+
377
+ # Configure LLM
378
+ llm_model = details.get('llm')
379
+ if llm_model:
380
+ llm = PraisonAIModel(
381
+ model=llm_model.get("model", os.environ.get("MODEL_NAME", "openai/gpt-4o")),
382
+ ).get_model()
383
+ else:
384
+ llm = PraisonAIModel().get_model()
385
+
386
+ # Configure function calling LLM
387
+ function_calling_llm_model = details.get('function_calling_llm')
388
+ if function_calling_llm_model:
389
+ function_calling_llm = PraisonAIModel(
390
+ model=function_calling_llm_model.get("model", os.environ.get("MODEL_NAME", "openai/gpt-4o")),
391
+ ).get_model()
392
+ else:
393
+ function_calling_llm = PraisonAIModel().get_model()
394
+
395
+ # Create CrewAI agent
396
+ agent = Agent(
397
+ role=role_filled,
398
+ goal=goal_filled,
399
+ backstory=backstory_filled,
400
+ tools=agent_tools,
401
+ allow_delegation=details.get('allow_delegation', False),
402
+ llm=llm,
403
+ function_calling_llm=function_calling_llm,
404
+ max_iter=details.get('max_iter', 15),
405
+ max_rpm=details.get('max_rpm'),
406
+ max_execution_time=details.get('max_execution_time'),
407
+ verbose=details.get('verbose', True),
408
+ cache=details.get('cache', True),
409
+ system_template=details.get('system_template'),
410
+ prompt_template=details.get('prompt_template'),
411
+ response_template=details.get('response_template'),
412
+ )
413
+
414
+ # Set agent callback if provided
415
+ if self.agent_callback:
416
+ agent.step_callback = self.agent_callback
417
+
418
+ agents[role] = agent
419
+
420
+ # Create tasks for the agent
421
+ for task_name, task_details in details.get('tasks', {}).items():
422
+ description_filled = task_details['description'].format(topic=topic)
423
+ expected_output_filled = task_details['expected_output'].format(topic=topic)
424
+
425
+ task = Task(
426
+ description=description_filled,
427
+ expected_output=expected_output_filled,
428
+ agent=agent,
429
+ tools=task_details.get('tools', []),
430
+ async_execution=task_details.get('async_execution', False),
431
+ context=[],
432
+ config=task_details.get('config', {}),
433
+ output_json=task_details.get('output_json'),
434
+ output_pydantic=task_details.get('output_pydantic'),
435
+ output_file=task_details.get('output_file', ""),
436
+ callback=task_details.get('callback'),
437
+ human_input=task_details.get('human_input', False),
438
+ create_directory=task_details.get('create_directory', False)
439
+ )
440
+
441
+ # Set task callback if provided
442
+ if self.task_callback:
443
+ task.callback = self.task_callback
444
+
445
+ tasks.append(task)
446
+ tasks_dict[task_name] = task
447
+
448
+ # Set up task contexts
449
+ for role, details in config['roles'].items():
450
+ for task_name, task_details in details.get('tasks', {}).items():
451
+ task = tasks_dict[task_name]
452
+ context_tasks = [tasks_dict[ctx] for ctx in task_details.get('context', [])
453
+ if ctx in tasks_dict]
454
+ task.context = context_tasks
455
+
456
+ # Create and run the crew
457
+ crew = Crew(
458
+ agents=list(agents.values()),
459
+ tasks=tasks,
460
+ verbose=2
461
+ )
462
+
463
+ self.logger.debug("Final Crew Configuration:")
464
+ self.logger.debug(f"Agents: {crew.agents}")
465
+ self.logger.debug(f"Tasks: {crew.tasks}")
466
+
467
+ response = crew.kickoff()
468
+ result = f"### Task Output ###\n{response}"
469
+
470
+ if AGENTOPS_AVAILABLE:
471
+ agentops.end_session("Success")
472
+
473
+ return result
474
+