(test) bedrock.cohere testing

This commit is contained in:
ishaan-jaff
2023-10-31 22:26:43 -07:00
parent fa7e063198
commit 2f6fed30ad
+22 -2
View File
@@ -408,7 +408,7 @@ def test_completion_openai_prompt_array():
response_str = response["choices"][0]["text"]
except Exception as e:
pytest.fail(f"Error occurred: {e}")
test_completion_openai_prompt_array()
# test_completion_openai_prompt_array()
def test_completion_hf_prompt_array():
try:
@@ -423,7 +423,7 @@ def test_completion_hf_prompt_array():
response_str = response["choices"][0]["text"]
except Exception as e:
pytest.fail(f"Error occurred: {e}")
test_completion_hf_prompt_array()
# test_completion_hf_prompt_array()
def test_completion_text_openai():
try:
@@ -879,6 +879,26 @@ def test_completion_bedrock_claude():
pytest.fail(f"Error occurred: {e}")
# test_completion_bedrock_claude()
def test_completion_bedrock_cohere():
print("calling bedrock cohere")
try:
response = completion(
model="bedrock/cohere.command-text-v14",
messages=[{"role": "user", "content": "hi"}],
temperature=0.1,
max_tokens=10,
stream=True
)
# Add any assertions here to check the response
print(response)
for chunk in response:
print(chunk)
except RateLimitError:
pass
except Exception as e:
pytest.fail(f"Error occurred: {e}")
# test_completion_bedrock_cohere()
def test_completion_bedrock_claude_completion_auth():
print("calling bedrock claude completion params auth")