Skip to content

Commit 23834e8

Browse files
hangfeicopybara-github
authored andcommitted
chore: Remove unused _get_audio_transcription_from_session function
This function is no longer called or needed within the `BaseLlmFlow` class. PiperOrigin-RevId: 806351470
1 parent de1c889 commit 23834e8

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

src/google/adk/flows/llm_flows/base_llm_flow.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -69,42 +69,6 @@
6969
DEFAULT_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-
10872
class BaseLlmFlow(ABC):
10973
"""A basic flow that calls the LLM in a loop until a final response is generated.
11074

0 commit comments

Comments
 (0)