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:
Xu Yang
2024-06-28 11:45:23 +08:00
committed by GitHub
parent bc8d96e96c
commit 6b626eb56d
62 changed files with 654 additions and 1120 deletions
+5 -2
View File
@@ -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)
+5 -1
View File
@@ -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()