RDBC-998 Write tests for Python AI Agents#266
Merged
poissoncorp merged 3 commits intoravendb:v7.1from Feb 27, 2026
Merged
Conversation
c6e9365 to
bb6e76f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RDBC-998 Write tests for Python AI Agents
Changes
ravendb/documents/operations/ai/agents/__init__.pyAiAgentToolQueryOptionsin the public API.ravendb/tests/ai_agent_tests/test_ai_agents.py— 15 integration testsCRUD operations against the real embedded test server.
test_create_and_get_agenttest_update_agenttest_delete_agenttest_agent_with_query_tooltest_agent_with_action_tooltest_agent_with_multiple_toolstest_agent_with_parameterstest_agent_connection_string_nametest_agent_system_prompttest_agent_identifiertest_list_agentstest_agent_with_query_tool_options_add_to_initial_contextAiAgentToolQueryOptions.add_to_initial_contextpersiststest_agent_with_query_tool_options_allow_model_queriesAiAgentToolQueryOptions.allow_model_queriespersiststest_create_multiple_agentstest_delete_nonexistent_agentravendb/tests/ai_agent_tests/test_ai_agents_conversation_mock.py— 21 hybrid testsAgent CRUD runs against the real server;
store.maintenance.sendis patched soRunConversationOperationcalls return craftedConversationResultobjects — noLLM API key required.
test_basic_conversation_returns_answerrun()returns the mocked answertest_conversation_id_and_change_vector_are_stored_conversation_id/_change_vectorare updated after a calltest_usage_is_populatedAiUsagefields (prompt/completion/total tokens) are propagatedtest_elapsed_is_populatedtest_context_manager_usageAiConversationworks as a context managertest_handle_invokes_handler_and_sends_responsehandle()callback is called with parsed args; response is sent backtest_receive_invokes_handler_with_request_and_argsreceive()callback receives both the raw request and parsed argstest_multi_turn_action_looprun()loops correctly across multiple ACTION_REQUIRED turns until DONEtest_handler_error_send_to_modelSEND_ERRORS_TO_MODEL— conversation continuestest_handler_error_raise_immediatelyRAISE_IMMEDIATELY— exception propagatestest_on_unhandled_action_is_calledon_unhandled_actioncallback fires; conversation continues after fallback responsetest_no_handler_raises_runtime_erroron_unhandled_action→RuntimeErrortest_add_artificial_action_with_responseadd_artificial_action_with_response()injects the action into the operationtest_add_artificial_action_validates_tool_idValueErrortest_add_artificial_action_validates_response_not_noneNoneresponse raisesValueErrortest_conversation_with_creation_optionsAiConversationCreationOptions(parameters, expiration) are forwarded to the operationtest_stream_collects_chunks_and_returns_answerstream()completes and returns a DONE resulttest_set_user_prompt_empty_raisesValueErrortest_required_actions_before_run_raisesrequired_actionsbeforerun()raisesRuntimeErrortest_required_actions_after_run_returns_listrequired_actionsreturns an empty list after a DONE resulttest_duplicate_action_handler_raisesValueError