Upload llmdolphin.py
Browse files- llmdolphin.py +9 -2
llmdolphin.py
CHANGED
|
@@ -941,13 +941,20 @@ def list_uniq(l: list):
|
|
| 941 |
return sorted(set(l), key=l.index)
|
| 942 |
|
| 943 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 944 |
def get_state(state: dict, key: str):
|
| 945 |
if key in state.keys(): return state[key]
|
|
|
|
|
|
|
|
|
|
| 946 |
else:
|
| 947 |
-
print(f"State '{key}' not found.")
|
| 948 |
return None
|
| 949 |
|
| 950 |
-
|
| 951 |
def set_state(state: dict, key: str, value: Any):
|
| 952 |
state[key] = value
|
| 953 |
|
|
|
|
| 941 |
return sorted(set(l), key=l.index)
|
| 942 |
|
| 943 |
|
| 944 |
+
DEFAULT_STATE = {
|
| 945 |
+
"dolphin_sysprompt_mode": "Default",
|
| 946 |
+
"dolphin_output_language": llm_languages[0],
|
| 947 |
+
}
|
| 948 |
+
|
| 949 |
def get_state(state: dict, key: str):
|
| 950 |
if key in state.keys(): return state[key]
|
| 951 |
+
elif key in DEFAULT_STATE.keys():
|
| 952 |
+
print(f"State '{key}' not found. Use dedault value.")
|
| 953 |
+
return DEFAULT_STATE[key]
|
| 954 |
else:
|
| 955 |
+
print(f"State '{key}' not found. Use dedault value.")
|
| 956 |
return None
|
| 957 |
|
|
|
|
| 958 |
def set_state(state: dict, key: str, value: Any):
|
| 959 |
state[key] = value
|
| 960 |
|