magicboris commited on
Commit
b6960cd
·
verified ·
1 Parent(s): 7858064

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -58,25 +58,23 @@ def chat_request(messages, temp, system, model=None):
58
  ]
59
 
60
  if not system:
61
- system = [{"type": "text", "text": "- Please ensure that each step includes all required fields and that the steps are logically ordered.\n- Please ensure each code block you emit is INDENTED either using spaces or tabs the original context."}]
62
 
63
  system = prepend_prompt + system
64
-
65
- # anthropic/claude-3-5-sonnet:beta doesn't work
66
- if model == "anthropic/claude-3-5-sonnet:beta":
67
- model = "claude-3-5-sonnet-20241022"
68
- else:
69
- model = model or "claude-3-5-sonnet-20241022"
70
 
71
  payload = {
72
- "model": model,
73
  "temperature": temp,
74
  "stream": True,
75
  "messages": [
76
- {"role": "system", "content": system},
77
- _messages
 
 
 
78
  ]
79
  }
 
80
  resp = requests.post(
81
  API_ENDPOINT,
82
  headers={
 
58
  ]
59
 
60
  if not system:
61
+ system = [{"type": "text", "text": "You are a helpful assistant that follows all user instructing."}]
62
 
63
  system = prepend_prompt + system
 
 
 
 
 
 
64
 
65
  payload = {
66
+ "model": model if model else "claude-3-5-sonnet-20241022",
67
  "temperature": temp,
68
  "stream": True,
69
  "messages": [
70
+ {
71
+ "role": "system",
72
+ "content": system
73
+ },
74
+ *messages
75
  ]
76
  }
77
+
78
  resp = requests.post(
79
  API_ENDPOINT,
80
  headers={