File tree Expand file tree Collapse file tree 1 file changed +0
-36
lines changed
src/google/adk/flows/llm_flows Expand file tree Collapse file tree 1 file changed +0
-36
lines changed Original file line number Diff line number Diff line change 6969DEFAULT_ENABLE_CACHE_STATISTICS = False
7070
7171
72- def _get_audio_transcription_from_session (
73- invocation_context : InvocationContext ,
74- ) -> list [types .Content ]:
75- """Get audio and transcription content from session events.
76-
77- Collects audio file references and transcription text from session events
78- to reconstruct the conversation history including multimodal content.
79- Args:
80- invocation_context: The invocation context containing session data.
81- Returns:
82- A list of Content objects containing audio files and transcriptions.
83- """
84- contents = []
85-
86- for event in invocation_context .session .events :
87- # Collect transcription text events
88- if hasattr (event , 'input_transcription' ) and event .input_transcription :
89- contents .append (
90- types .Content (
91- role = 'user' ,
92- parts = [types .Part .from_text (text = event .input_transcription .text )],
93- )
94- )
95-
96- if hasattr (event , 'output_transcription' ) and event .output_transcription :
97- contents .append (
98- types .Content (
99- role = 'model' ,
100- parts = [
101- types .Part .from_text (text = event .output_transcription .text )
102- ],
103- )
104- )
105- return contents
106-
107-
10872class BaseLlmFlow (ABC ):
10973 """A basic flow that calls the LLM in a loop until a final response is generated.
11074
You can’t perform that action at this time.
0 commit comments