File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,17 @@ class TestExamples:
24
24
@patch ("argparse.ArgumentParser.parse_args" )
25
25
def test_prompt (self , mock_parse_args ):
26
26
"""Test prompt example."""
27
- mock_args = MagicMock ()
28
- mock_args .system_prompt = """you are a helpful assistant. If you are prompted,
27
+ system_prompt = """you are a helpful assistant. If you are prompted,
29
28
'this is a test', then return the word 'SUCCESS' in upper case. Return only
30
29
this single word, in upper case. Do not embellish. do not further prompt
31
30
the user for any reason."""
31
+
32
+ mock_args = MagicMock ()
33
+ mock_args .system_prompt = system_prompt
32
34
mock_args .human_prompt = HUMAN_MESSAGE
33
35
mock_parse_args .return_value = mock_args
34
36
35
- system_message = SystemMessage (content = "you are a helpful assistant" )
37
+ system_message = SystemMessage (content = system_prompt )
36
38
human_message = HumanMessage (content = HUMAN_MESSAGE )
37
39
result = prompt_hrs .cached_chat_request (system_message = system_message , human_message = human_message )
38
40
assert result .content == "SUCCESS"
You can’t perform that action at this time.
0 commit comments