MCPcopy Index your code
hub / github.com/google/adk-python / add_session_to_eval_set

Method add_session_to_eval_set

src/google/adk/cli/dev_server.py:843–876  ·  view source on GitHub ↗
(
        app_name: str, eval_set_id: str, req: AddSessionToEvalSetRequest
    )

Source from the content-addressed store, hash-verified

841 tags=[TAG_EVALUATION],
842 )
843 async def add_session_to_eval_set(
844 app_name: str, eval_set_id: str, req: AddSessionToEvalSetRequest
845 ):
846 # Get the session
847 session = await self.session_service.get_session(
848 app_name=app_name, user_id=req.user_id, session_id=req.session_id
849 )
850 assert session, "Session not found."
851
852 # Convert the session data to eval invocations
853 invocations = evals.convert_session_to_eval_invocations(session)
854
855 # Populate the session with initial session state.
856 agent_or_app = self.agent_loader.load_agent(app_name)
857 root_agent = self._get_root_agent(agent_or_app)
858 initial_session_state = create_empty_state(root_agent)
859
860 new_eval_case = EvalCase(
861 eval_id=req.eval_id,
862 conversation=invocations,
863 session_input=SessionInput(
864 app_name=app_name,
865 user_id=req.user_id,
866 state=initial_session_state,
867 ),
868 creation_timestamp=time.time(),
869 )
870
871 try:
872 self.eval_sets_manager.add_eval_case(
873 app_name, eval_set_id, new_eval_case
874 )
875 except ValueError as ve:
876 raise HTTPException(status_code=400, detail=str(ve)) from ve
877
878 @app.get(
879 "/dev/apps/{app_name}/eval_sets/{eval_set_id}/evals",

Callers

nothing calls this directly

Calls 8

create_empty_stateFunction · 0.85
EvalCaseClass · 0.85
SessionInputClass · 0.85
_get_root_agentMethod · 0.80
timeMethod · 0.80
get_sessionMethod · 0.45
load_agentMethod · 0.45
add_eval_caseMethod · 0.45

Tested by

no test coverage detected