Add ux profiles and advanced config block
This commit is contained in:
parent
c8739b6804
commit
77ae21d0f6
4 changed files with 68 additions and 3 deletions
|
|
@ -14,6 +14,7 @@ import aiprocess
|
|||
from aiprocess import (
|
||||
_assert_expected_model_checksum,
|
||||
_extract_cleaned_text,
|
||||
_profile_generation_kwargs,
|
||||
_supports_response_format,
|
||||
ensure_model,
|
||||
)
|
||||
|
|
@ -93,6 +94,22 @@ class SupportsResponseFormatTests(unittest.TestCase):
|
|||
|
||||
self.assertFalse(_supports_response_format(chat_completion))
|
||||
|
||||
def test_fast_profile_sets_max_tokens_when_supported(self):
|
||||
def chat_completion(*, messages, temperature, max_tokens):
|
||||
return None
|
||||
|
||||
kwargs = _profile_generation_kwargs(chat_completion, "fast")
|
||||
|
||||
self.assertEqual(kwargs, {"max_tokens": 192})
|
||||
|
||||
def test_non_fast_profile_does_not_set_generation_overrides(self):
|
||||
def chat_completion(*, messages, temperature, max_tokens):
|
||||
return None
|
||||
|
||||
kwargs = _profile_generation_kwargs(chat_completion, "polished")
|
||||
|
||||
self.assertEqual(kwargs, {})
|
||||
|
||||
|
||||
class ModelChecksumTests(unittest.TestCase):
|
||||
def test_accepts_expected_checksum_case_insensitive(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue