Skip to content

Commit

Permalink
added top_p
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalPazz committed Jul 1, 2023
1 parent 916a028 commit 432b155
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@ async def test_get_llm_api_client__with_anthropic(config):

assert isinstance(actual, AnthropicClient)


@pytest.mark.asyncio
async def test_text_completion__sanity(mock_aioresponse, llm_client, complete_url, anthropic_version):
mock_aioresponse.post(
complete_url,
payload={COMPLETIONS_KEY: "completion text"}
)

actual = await llm_client.text_completion(prompt="These are a few of my favorite", max_tokens=10)
actual = await llm_client.text_completion(prompt="These are a few of my favorite", max_tokens=10,)

assert actual == ["completion text"]
mock_aioresponse.assert_called_once_with(complete_url, method='POST',
headers={AUTH_HEADER: llm_client._api_key,
ACCEPT_HEADER: ACCEPT_VALUE,
VERSION_HEADER: anthropic_version},
json={PROMPT_KEY: 'These are a few of my favorite',
MAX_TOKENS_KEY: 10, "temperature": 1,
MAX_TOKENS_KEY: 10, "temperature": 1,"top_p" : -1,
MODEL_KEY: llm_client._default_model},
raise_for_status=True)

Expand All @@ -52,7 +51,7 @@ async def test_text_completion__with_version_header(mock_aioresponse, config, co
ACCEPT_HEADER: ACCEPT_VALUE,
VERSION_HEADER: "1.0.0"},
json={PROMPT_KEY: 'These are a few of my favorite',
MAX_TOKENS_KEY: 10, "temperature": 1,
MAX_TOKENS_KEY: 10, "temperature": 1,"top_p" : -1,
MODEL_KEY: llm_client._default_model},
raise_for_status=True)

Expand Down Expand Up @@ -102,7 +101,7 @@ async def test_text_completion__with_kwargs(mock_aioresponse, llm_client, comple
json={PROMPT_KEY: 'These are a few of my favorite',
MAX_TOKENS_KEY: 10,
MODEL_KEY: llm_client._default_model,
"temperature": 0.5},
"temperature": 0.5,"top_p" : -1},
raise_for_status=True)


Expand Down

0 comments on commit 432b155

Please sign in to comment.