You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- it("should handle payload with system message correctly", function()
21
-
-- local input = {
22
-
-- max_tokens = 4096,
23
-
-- messages = {
24
-
-- {
25
-
-- content = "You are a versatile AI assistant with capabilities\nextending to general knowledge and coding support. When engaging\nwith users, please adhere to the following guidelines to ensure\nthe highest quality of interaction:\n\n- Admit when unsure by saying 'I don't know.'\n- Ask for clarification when needed.\n- Use first principles thinking to analyze queries.\n- Start with the big picture, then focus on details.\n- Apply the Socratic method to enhance understanding.\n- Include all necessary code in your responses.\n- Stay calm and confident with each task.\n",
26
-
-- role = "system",
27
-
-- },
28
-
-- { content = "Who are you?", role = "user" },
29
-
-- },
30
-
-- model = "claude-3-haiku-20240307",
31
-
-- stream = true,
32
-
-- }
33
-
--
34
-
-- local expected = {
35
-
-- max_tokens = 4096,
36
-
-- messages = {
37
-
-- { content = "Who are you?", role = "user" },
38
-
-- },
39
-
-- model = "claude-3-haiku-20240307",
40
-
-- stream = true,
41
-
-- system = "You are a versatile AI assistant with capabilities\nextending to general knowledge and coding support. When engaging\nwith users, please adhere to the following guidelines to ensure\nthe highest quality of interaction:\n\n- Admit when unsure by saying 'I don't know.'\n- Ask for clarification when needed.\n- Use first principles thinking to analyze queries.\n- Start with the big picture, then focus on details.\n- Apply the Socratic method to enhance understanding.\n- Include all necessary code in your responses.\n- Stay calm and confident with each task.",
42
-
-- }
43
-
--
44
-
-- local result = anthropic:preprocess_payload(input)
45
-
--
46
-
-- assert.are.same(expected, result)
47
-
-- end)
48
-
-- end)
18
+
describe("preprocess_payload", function()
19
+
it("should handle payload with system message correctly", function()
20
+
localinput= {
21
+
max_tokens=4096,
22
+
messages= {
23
+
{
24
+
content="You are a versatile AI assistant with capabilities\nextending to general knowledge and coding support. When engaging\nwith users, please adhere to the following guidelines to ensure\nthe highest quality of interaction:\n\n- Admit when unsure by saying 'I don't know.'\n- Ask for clarification when needed.\n- Use first principles thinking to analyze queries.\n- Start with the big picture, then focus on details.\n- Apply the Socratic method to enhance understanding.\n- Include all necessary code in your responses.\n- Stay calm and confident with each task.\n",
25
+
role="system",
26
+
},
27
+
{ content="Who are you?", role="user" },
28
+
},
29
+
model="claude-3-haiku-20240307",
30
+
stream=true,
31
+
}
32
+
33
+
localexpected= {
34
+
max_tokens=4096,
35
+
messages= {
36
+
{ content="Who are you?", role="user" },
37
+
},
38
+
model="claude-3-haiku-20240307",
39
+
stream=true,
40
+
system="You are a versatile AI assistant with capabilities\nextending to general knowledge and coding support. When engaging\nwith users, please adhere to the following guidelines to ensure\nthe highest quality of interaction:\n\n- Admit when unsure by saying 'I don't know.'\n- Ask for clarification when needed.\n- Use first principles thinking to analyze queries.\n- Start with the big picture, then focus on details.\n- Apply the Socratic method to enhance understanding.\n- Include all necessary code in your responses.\n- Stay calm and confident with each task.",
41
+
}
42
+
43
+
localresult=anthropic:preprocess_payload(input)
44
+
45
+
assert.are.same(expected, result)
46
+
end)
47
+
end)
49
48
50
49
describe("verify", function()
51
50
it("should return true for a valid API key", function()
0 commit comments