hjxdl 0.1.24__py3-none-any.whl → 0.1.25__py3-none-any.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.
- hdl/_version.py +2 -2
- hdl/utils/llm/chat.py +31 -0
- {hjxdl-0.1.24.dist-info → hjxdl-0.1.25.dist-info}/METADATA +1 -1
- {hjxdl-0.1.24.dist-info → hjxdl-0.1.25.dist-info}/RECORD +6 -6
- {hjxdl-0.1.24.dist-info → hjxdl-0.1.25.dist-info}/WHEEL +0 -0
- {hjxdl-0.1.24.dist-info → hjxdl-0.1.25.dist-info}/top_level.txt +0 -0
hdl/_version.py
CHANGED
hdl/utils/llm/chat.py
CHANGED
@@ -434,6 +434,18 @@ class OpenAI_M():
|
|
434
434
|
prompt: str,
|
435
435
|
**kwargs: t.Any
|
436
436
|
):
|
437
|
+
"""Get decision based on the provided prompt and additional keyword arguments.
|
438
|
+
|
439
|
+
Args:
|
440
|
+
prompt (str): The prompt for decision making.
|
441
|
+
**kwargs: Additional keyword arguments.
|
442
|
+
|
443
|
+
Returns:
|
444
|
+
dict: A dictionary containing the decision.
|
445
|
+
|
446
|
+
Example:
|
447
|
+
decision = get_decision("Should I buy this product?", option1="yes", option2="no")
|
448
|
+
"""
|
437
449
|
prompt_final = FN_TEMPLATE
|
438
450
|
for tool in self.tools:
|
439
451
|
prompt_final += self.tool_desc.get(tool.__name__, "")
|
@@ -448,6 +460,15 @@ class OpenAI_M():
|
|
448
460
|
prompt: str,
|
449
461
|
**kwargs: t.Any
|
450
462
|
):
|
463
|
+
"""Get the result from a tool based on the provided prompt and keyword arguments.
|
464
|
+
|
465
|
+
Args:
|
466
|
+
prompt (str): The prompt to get the decision for.
|
467
|
+
**kwargs: Additional keyword arguments to pass to the decision function.
|
468
|
+
|
469
|
+
Returns:
|
470
|
+
str: The result from the selected tool based on the decision made.
|
471
|
+
"""
|
451
472
|
decision_dict = self.get_decision(prompt, **kwargs)
|
452
473
|
if decision_dict.get("function_name", None) is None:
|
453
474
|
return ""
|
@@ -466,7 +487,17 @@ class OpenAI_M():
|
|
466
487
|
stream = True,
|
467
488
|
**kwargs: t.Any
|
468
489
|
):
|
490
|
+
"""'''Generate agent response based on the given prompt.
|
491
|
+
|
492
|
+
Args:
|
493
|
+
prompt (str): The prompt for which agent response is generated.
|
494
|
+
stream (bool, optional): Flag to determine if the response should be streamed. Defaults to True.
|
495
|
+
**kwargs: Additional keyword arguments.
|
469
496
|
|
497
|
+
Returns:
|
498
|
+
str: The agent response based on the prompt.
|
499
|
+
'''
|
500
|
+
"""
|
470
501
|
decision_dict = self.get_decision(prompt, **kwargs)
|
471
502
|
if decision_dict.get("function_name", None) is None:
|
472
503
|
return self.stream(prompt, **kwargs)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
hdl/__init__.py,sha256=GffnD0jLJdhkd-vo989v40N90sQbofkayRBwxc6TVhQ,72
|
2
|
-
hdl/_version.py,sha256=
|
2
|
+
hdl/_version.py,sha256=2z8sOHys3QouaDyoTFldOod5mPhdtLw8dgODNwh6eyY,413
|
3
3
|
hdl/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
hdl/args/loss_args.py,sha256=s7YzSdd7IjD24rZvvOrxLLFqMZQb9YylxKeyelSdrTk,70
|
5
5
|
hdl/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -125,14 +125,14 @@ hdl/utils/desc/template.py,sha256=uKPGIgYFgSY4uBvfsbh5fZN7s39NdGQ2XSVH3pIpsuc,10
|
|
125
125
|
hdl/utils/general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
126
126
|
hdl/utils/general/glob.py,sha256=8-RCnt6L297wMIfn34ZAMCsGCZUjHG3MGglGZI1cX0g,491
|
127
127
|
hdl/utils/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
128
|
-
hdl/utils/llm/chat.py,sha256=
|
128
|
+
hdl/utils/llm/chat.py,sha256=cpXgfHtjDz0A5HIInwODQ2kM04hdDsllTqalOU9wmQs,17784
|
129
129
|
hdl/utils/llm/embs.py,sha256=Tf0FOYrOFZp7qQpEPiSCXzlgyHH0X9HVTUtsup74a9E,7174
|
130
130
|
hdl/utils/llm/extract.py,sha256=2sK_WJzmYIc8iuWaM9DA6Nw3_6q1O4lJ5pKpcZo-bBA,6512
|
131
131
|
hdl/utils/schedulers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
132
132
|
hdl/utils/schedulers/norm_lr.py,sha256=bDwCmdEK-WkgxQMFBiMuchv8Mm7C0-GZJ6usm-PQk14,4461
|
133
133
|
hdl/utils/weather/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
134
134
|
hdl/utils/weather/weather.py,sha256=k11o6wM15kF8b9NMlEfrg68ak-SfSYLN3nOOflFUv-I,4381
|
135
|
-
hjxdl-0.1.
|
136
|
-
hjxdl-0.1.
|
137
|
-
hjxdl-0.1.
|
138
|
-
hjxdl-0.1.
|
135
|
+
hjxdl-0.1.25.dist-info/METADATA,sha256=nOQQlDQJmZ6C5W5oedJIMy_5cB1HLtwgJC6PJlFw8pg,627
|
136
|
+
hjxdl-0.1.25.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
137
|
+
hjxdl-0.1.25.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
|
138
|
+
hjxdl-0.1.25.dist-info/RECORD,,
|
File without changes
|
File without changes
|