Commit Graph

5 Commits

Author SHA1 Message Date
Devin AI
76fea442d4 Fix LiteAgent test mocking: return AgentFinish object instead of raw string
- Mock _invoke_loop to return proper AgentFinish object with output attribute
- This should resolve the 'str' object has no attribute 'output' error in CI

Co-Authored-By: João <joao@crewai.com>
2025-06-24 05:38:46 +00:00
Devin AI
b1ae914cd3 Fix integration test failures: correct mocking and attribute access
- Fix test_crew_with_llm_parameters: mock _run_sequential_process instead of kickoff to avoid circular mocking
- Fix test_lite_agent_with_xml_extraction: access result.raw instead of result.output for LiteAgentOutput

Co-Authored-By: João <joao@crewai.com>
2025-06-24 05:35:00 +00:00
Devin AI
14629bb87a Fix CI failures: resolve type checker errors and test failures
- Fix type checker errors in reasoning_handler.py: handle Union[str, dict] response types
- Fix type checker error in crew_chat.py: convert final_response to string for dict
- Update test_task_callback_returns_task_output to include completion_metadata field
- Fix integration test attribute access in test_lite_agent_with_xml_extraction

Co-Authored-By: João <joao@crewai.com>
2025-06-24 05:29:55 +00:00
Devin AI
a1ebdb125b Fix CI issues: lint, type checker, and test failures
- Remove unused imports from test and example files
- Fix f-string formatting in examples
- Add proper type handling for Union[str, Dict] in agent_utils.py
- Fix XML parser test assertion to match expected output
- Use isinstance() for proper type narrowing in LLM calls

Co-Authored-By: João <joao@crewai.com>
2025-06-24 05:21:30 +00:00
Devin AI
39ea952acd Implement LLM generations, logprobs, and XML parsing features
- Add support for n generations and logprobs parameters in LLM class
- Extend Agent class to accept LLM generation parameters (llm_n, llm_logprobs, llm_top_logprobs)
- Add return_full_completion parameter to access complete LLM response metadata
- Implement XML parser utility for extracting content from tags like <thinking>
- Add completion metadata support to TaskOutput and LiteAgentOutput classes
- Add comprehensive tests and examples demonstrating new functionality
- Maintain full backward compatibility with existing code

Addresses issue #3052: How to obtain n generations or generations in different tags

Co-Authored-By: João <joao@crewai.com>
2025-06-24 05:14:22 +00:00