mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
removing logs
This commit is contained in:
@@ -302,7 +302,6 @@ class ToolUsage:
|
|||||||
) -> Union[ToolCalling, InstructorToolCalling]:
|
) -> Union[ToolCalling, InstructorToolCalling]:
|
||||||
try:
|
try:
|
||||||
if self.function_calling_llm:
|
if self.function_calling_llm:
|
||||||
print("self.function_calling_llm")
|
|
||||||
model = (
|
model = (
|
||||||
InstructorToolCalling
|
InstructorToolCalling
|
||||||
if self.function_calling_llm.supports_function_calling()
|
if self.function_calling_llm.supports_function_calling()
|
||||||
@@ -323,9 +322,7 @@ class ToolUsage:
|
|||||||
),
|
),
|
||||||
max_attempts=1,
|
max_attempts=1,
|
||||||
)
|
)
|
||||||
print("converter", converter)
|
|
||||||
tool_object = converter.to_pydantic()
|
tool_object = converter.to_pydantic()
|
||||||
print("tool_object", tool_object)
|
|
||||||
calling = ToolCalling(
|
calling = ToolCalling(
|
||||||
tool_name=tool_object["tool_name"],
|
tool_name=tool_object["tool_name"],
|
||||||
arguments=tool_object["arguments"],
|
arguments=tool_object["arguments"],
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ def handle_partial_json(
|
|||||||
converter_cls: Optional[Type[Converter]] = None,
|
converter_cls: Optional[Type[Converter]] = None,
|
||||||
) -> Union[dict, BaseModel, str]:
|
) -> Union[dict, BaseModel, str]:
|
||||||
match = re.search(r"({.*})", result, re.DOTALL)
|
match = re.search(r"({.*})", result, re.DOTALL)
|
||||||
print("handle_partial_json")
|
|
||||||
if match:
|
if match:
|
||||||
try:
|
try:
|
||||||
exported_result = model.model_validate_json(match.group(0))
|
exported_result = model.model_validate_json(match.group(0))
|
||||||
@@ -161,11 +160,8 @@ def convert_with_instructions(
|
|||||||
agent: Any,
|
agent: Any,
|
||||||
converter_cls: Optional[Type[Converter]] = None,
|
converter_cls: Optional[Type[Converter]] = None,
|
||||||
) -> Union[dict, BaseModel, str]:
|
) -> Union[dict, BaseModel, str]:
|
||||||
print("convert_with_instructions")
|
|
||||||
llm = agent.function_calling_llm or agent.llm
|
llm = agent.function_calling_llm or agent.llm
|
||||||
print("llm", llm)
|
|
||||||
instructions = get_conversion_instructions(model, llm)
|
instructions = get_conversion_instructions(model, llm)
|
||||||
print("instructions", instructions)
|
|
||||||
converter = create_converter(
|
converter = create_converter(
|
||||||
agent=agent,
|
agent=agent,
|
||||||
converter_cls=converter_cls,
|
converter_cls=converter_cls,
|
||||||
@@ -174,11 +170,9 @@ def convert_with_instructions(
|
|||||||
model=model,
|
model=model,
|
||||||
instructions=instructions,
|
instructions=instructions,
|
||||||
)
|
)
|
||||||
print("converter", converter)
|
|
||||||
exported_result = (
|
exported_result = (
|
||||||
converter.to_pydantic() if not is_json_output else converter.to_json()
|
converter.to_pydantic() if not is_json_output else converter.to_json()
|
||||||
)
|
)
|
||||||
print("exported_result", exported_result)
|
|
||||||
|
|
||||||
if isinstance(exported_result, ConverterError):
|
if isinstance(exported_result, ConverterError):
|
||||||
Printer().print(
|
Printer().print(
|
||||||
|
|||||||
Reference in New Issue
Block a user