-
Notifications
You must be signed in to change notification settings - Fork 0
/
lm_mock.py
71 lines (52 loc) · 2.21 KB
/
lm_mock.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from singleton_decorator import singleton
from lm import LM
class LM_Mock(LM):
"""
Language model mock implementation.
Canned responses from granite-8b-code-instruct
"""
def start_agent(self, user_task: str) -> str:
"""
Kick-off agentic session by posing the user_task to the LM and
offering tools.
Returns the next function call for further processing, e.g. 'get_bundestag_transcript(...)'
"""
return 'get_bundestag_transcript("https://dbtg.tv/cvid/7611506")'
def get_bundestag_transcript(self, url: str, screenshot_desc: str) -> str:
"""
Corresponds to Agent task 'get_bundestag_transcript'.
Returns the next function call for further processing, e.g. 'find_options_button()'
"""
return 'find_options_button()'
def get_dl_btn(self, screenshot_desc: str) -> str:
"""
Corresponds to Agent task 'get_dl_btn'.
Returns the next function call for further processing, e.g. 'find_download_button(...)'
"""
return 'find_download_button()'
def get_subtitles_btn(self, screenshot_desc: str) -> str:
"""
Corresponds to Agent task 'get_subtitles_btn'.
Returns the next function call for further processing, e.g. 'find_subtitles_button(...)'
"""
return 'find_subtitles_button()'
def get_confirm_btn(self, screenshot_desc: str) -> str:
"""
Corresponds to Agent task 'get_confirmation_btn'.
Returns the next function call for further processing, e.g. 'find_confirm_button(...)'
"""
return 'find_confirm_button()'
def summarize_for_audience(self, payload_input_text: str, target_audience: str) -> str:
"""
Summarize a long text for a specific audience
"""
return """## Text Summary:
**Digital Committee Meeting Summary:**
**Background:**
The Digital Committee discussed [...]
**Key Findings:**
* Affordability concerns
* Accessibility disparities
* Technological advancements
**Conclusion:**
The committee emphasized the iterative approach in evaluating and refining digitalization programs, while seeking to streamline the process and reduce bureaucratic burden."""