mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-07 03:57:45 +00:00
New Framework for idea proposal and implementation on RD-Agent (#34)
* Commit init framework * Co-authored-by: Yuante Li (FESCO Adecco Human Resources) <v-yuanteli@microsoft.com> Co-authored-by: XianBW <XianBW@users.noreply.github.com> * add an import * refine the whole framework * benchmark related framework * fix black and isort errors * move requirements to folder * fix black again --------- Co-authored-by: Young <afe.young@gmail.com> Co-authored-by: xuyang1 <xuyang1@microsoft.com>
This commit is contained in:
@@ -10,7 +10,8 @@ class TestChatCompletion(unittest.TestCase):
|
||||
system_prompt = "You are a helpful assistant."
|
||||
user_prompt = "What is your name?"
|
||||
response = APIBackend().build_messages_and_create_chat_completion(
|
||||
system_prompt=system_prompt, user_prompt=user_prompt,
|
||||
system_prompt=system_prompt,
|
||||
user_prompt=user_prompt,
|
||||
)
|
||||
assert response is not None
|
||||
assert isinstance(response, str)
|
||||
@@ -19,7 +20,9 @@ class TestChatCompletion(unittest.TestCase):
|
||||
system_prompt = "You are a helpful assistant. answer in Json format."
|
||||
user_prompt = "What is your name?"
|
||||
response = APIBackend().build_messages_and_create_chat_completion(
|
||||
system_prompt=system_prompt, user_prompt=user_prompt, json_mode=True,
|
||||
system_prompt=system_prompt,
|
||||
user_prompt=user_prompt,
|
||||
json_mode=True,
|
||||
)
|
||||
assert response is not None
|
||||
assert isinstance(response, str)
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import unittest
|
||||
|
||||
from rdagent.oai.llm_utils import APIBackend, calculate_embedding_distance_between_str_list
|
||||
from rdagent.oai.llm_utils import (
|
||||
APIBackend,
|
||||
calculate_embedding_distance_between_str_list,
|
||||
)
|
||||
|
||||
|
||||
class TestEmbedding(unittest.TestCase):
|
||||
@@ -17,5 +20,6 @@ class TestEmbedding(unittest.TestCase):
|
||||
min_similarity_threshold = 0.8
|
||||
assert similarity >= min_similarity_threshold
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user