gtani commited on
Commit
69f182f
·
verified ·
1 Parent(s): e71ef4d

Delete test copy.py

Browse files
Files changed (1) hide show
  1. test copy.py +0 -40
test copy.py DELETED
@@ -1,40 +0,0 @@
1
- #%%
2
- from langchain.schema import SystemMessage, HumanMessage, AIMessage
3
-
4
-
5
- # Define your system prompt as a plain string
6
-
7
-
8
-
9
- def build_messages(
10
- user_message: str,
11
- history: list[dict]) -> list:
12
-
13
- system_prompt = "Du bist DevalBot, ein konversationeller Assistent des Deutschen Evaluierungsinstituts " \
14
- "für Entwicklungsbewertung (DEval). DEval bietet staatlichen und zivilgesellschaftlichen " \
15
- "Organisationen in der Entwicklungszusammenarbeit unabhängige und wissenschaftlich fundierte " \
16
- "Evaluierungen. Deine Hauptsprache ist Deutsch; antworte daher standardmäßig auf Deutsch. " \
17
- "Du kannst zudem bei statistischen Analysen und Programmierung in Stata und R unterstützen."
18
-
19
- messages: list = []
20
-
21
- # 1) Add the system prompt first
22
- messages.append(SystemMessage(content=system_prompt))
23
-
24
- # 2) Walk the history and map to HumanMessage or AIMessage
25
- for msg in history:
26
- if msg["role"] == "user":
27
- messages.append(HumanMessage(content=msg["content"]))
28
- elif msg["role"] == "assistant":
29
- messages.append(AIMessage(content=msg["content"]))
30
- else:
31
- # you can choose to ignore or log unexpected roles
32
- continue
33
-
34
- # 3) Finally, append the new user message
35
- messages.append(HumanMessage(content=user_message))
36
- return messages
37
-
38
-
39
- build_messages('hi',[])
40
- #%%