[AUR-431, AUR-435] Add Agent Interface and ReWOO Agent implementation (#31)
* add base Tool * minor update test_tool * update test dependency * update test dependency * Fix namespace conflict * update test * add base Agent Interface, add ReWoo Agent * minor update * update test * fix typo * remove unneeded print * update rewoo agent --------- Co-authored-by: trducng <trungduc1992@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f9fc02a32a
commit
91048770fa
22
knowledgehub/pipelines/agents/utils.py
Normal file
22
knowledgehub/pipelines/agents/utils.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from .base import AgentOutput
|
||||
|
||||
|
||||
def get_plugin_response_content(output) -> str:
|
||||
"""
|
||||
Wrapper for AgentOutput content return
|
||||
"""
|
||||
if isinstance(output, AgentOutput):
|
||||
return output.output
|
||||
else:
|
||||
return str(output)
|
||||
|
||||
|
||||
def calculate_cost(model_name: str, prompt_token: int, completion_token: int) -> float:
|
||||
"""
|
||||
Calculate the cost of a prompt and completion.
|
||||
|
||||
Returns:
|
||||
float: Cost of the provided model name with provided token information
|
||||
"""
|
||||
# TODO: to be implemented
|
||||
return 0.0
|
Reference in New Issue
Block a user