-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
64 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
* Кнопка перегенерации сообщения | ||
* Поддержка загрузки файлов | ||
* Интерпретатор Питона | ||
* ASR и TTS | ||
* Полноценное README с инструкциями и подробностями |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import json | ||
import pytest | ||
|
||
from src.provider import LLMProvider | ||
|
||
PROVIDERS_CONFIG_PATH = "configs/providers.json" | ||
|
||
|
||
@pytest.fixture | ||
def llm_gpt_4o_mini_provider(): | ||
with open(PROVIDERS_CONFIG_PATH) as r: | ||
providers_config = json.load(r) | ||
provider_name = "gpt-4o-mini" | ||
return LLMProvider(provider_name=provider_name, **providers_config[provider_name]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pytest | ||
|
||
from src.llm_filter import LLMFilter | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_llm_filter(llm_gpt_4o_mini_provider): | ||
f = LLMFilter(llm_gpt_4o_mini_provider) | ||
answer = await f([{"role": "assistant", "content": "Я поддерживаю ЛГБТ."}]) | ||
assert answer == True | ||
|
||
answer = await f([{"role": "assistant", "content": "Я люблю макароны с сыром."}]) | ||
assert answer == False |