Skip to content

Commit

Permalink
Update model version in test_cli_prompt.py
Browse files Browse the repository at this point in the history
- Changed the model version from 'gpt-4' to 'gpt-3.5-turbo' in tests.
- Updated the expected output in  test_prompt_with_function_replay.
  • Loading branch information
basicthinker committed Jul 20, 2023
1 parent e76c58d commit 1e23fe2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/test_cli_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ def fixture_functions_file(tmpdir):


def test_prompt_with_instruct(git_repo, temp_files): # pylint: disable=W0613
result = runner.invoke(main, ['prompt', '-m', 'gpt-4',
result = runner.invoke(main, ['prompt', '-m', 'gpt-3.5-turbo',
'-i', temp_files[0], '-i', temp_files[1],
"It is really scorching."])
assert result.exit_code == 0
assert get_content(result.output).find("hot\n") >= 0


def test_prompt_with_instruct_and_context(git_repo, temp_files): # pylint: disable=W0613
result = runner.invoke(main, ['prompt', '-m', 'gpt-4',
result = runner.invoke(main, ['prompt', '-m', 'gpt-3.5-turbo',
'-i', temp_files[0], '-i', temp_files[2],
'--context', temp_files[3],
"It is really scorching."])
Expand All @@ -108,7 +108,7 @@ def test_prompt_with_instruct_and_context(git_repo, temp_files): # pylint: disa

def test_prompt_with_functions(git_repo, functions_file): # pylint: disable=W0613
# call with -f option
result = runner.invoke(main, ['prompt', '-m', 'gpt-4', '-f', functions_file,
result = runner.invoke(main, ['prompt', '-m', 'gpt-3.5-turbo', '-f', functions_file,
"What is the weather like in Boston?"])

core_content = get_content(result.output)
Expand All @@ -118,7 +118,7 @@ def test_prompt_with_functions(git_repo, functions_file): # pylint: disable=W06
assert core_content.find('command') > 0

# compare with no -f options
result = runner.invoke(main, ['prompt', '-m', 'gpt-4',
result = runner.invoke(main, ['prompt', '-m', 'gpt-3.5-turbo',
'What is the weather like in Boston?'])

core_content = get_content(result.output)
Expand All @@ -129,7 +129,7 @@ def test_prompt_with_functions(git_repo, functions_file): # pylint: disable=W06

def test_prompt_log_with_functions(git_repo, functions_file): # pylint: disable=W0613
# call with -f option
result = runner.invoke(main, ['prompt', '-m', 'gpt-4', '-f', functions_file,
result = runner.invoke(main, ['prompt', '-m', 'gpt-3.5-turbo', '-f', functions_file,
'What is the weather like in Boston?'])

prompt_hash = get_prompt_hash(result.output)
Expand Down Expand Up @@ -159,24 +159,24 @@ def test_prompt_log_compatibility():

# test prompt with function replay
def test_prompt_with_function_replay(git_repo, functions_file): # pylint: disable=W0613
result = runner.invoke(main, ['prompt', '-m', 'gpt-4',
result = runner.invoke(main, ['prompt', '-m', 'gpt-3.5-turbo',
'-f', functions_file,
'-n', 'get_current_weather',
'{"temperature": "22", "unit": "celsius", "weather": "Sunny"}'])

core_content = get_content(result.output)
content = get_content(result.output)
assert result.exit_code == 0
assert core_content.find("finish_reason: stop") >= 0
assert core_content.find("The current weather is 22 degrees") >= 0
assert content.find("finish_reason: stop") >= 0
assert "22 degrees Celsius and sunny" in content

prompt_hash = get_prompt_hash(result.output)
result = runner.invoke(main, ['prompt', '-m', 'gpt-4',
result = runner.invoke(main, ['prompt', '-m', 'gpt-3.5-turbo',
'-p', prompt_hash,
'what is the GPT function name?'])

core_content = get_content(result.output)
content = get_content(result.output)
assert result.exit_code == 0
assert core_content.find("get_current_weather") >= 0
assert content.find("get_current_weather") >= 0


def test_prompt_response_tokens_exceed_config(git_repo): # pylint: disable=W0613
Expand Down

0 comments on commit 1e23fe2

Please sign in to comment.