Spaces:
Sleeping
Sleeping
Update test_case_generator.py
Browse files- test_case_generator.py +6 -7
test_case_generator.py
CHANGED
|
@@ -5,6 +5,7 @@ from langchain_openai import ChatOpenAI
|
|
| 5 |
from langchain_core.prompts import PromptTemplate
|
| 6 |
from langchain_community.document_loaders import PyPDFLoader
|
| 7 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
|
|
|
| 8 |
|
| 9 |
class TestCaseGenerator:
|
| 10 |
def __init__(self, api_key=None):
|
|
@@ -14,13 +15,11 @@ class TestCaseGenerator:
|
|
| 14 |
|
| 15 |
# Predefined question types
|
| 16 |
self.available_question_types = [
|
| 17 |
-
'
|
| 18 |
-
'
|
| 19 |
-
'
|
| 20 |
-
'
|
| 21 |
-
'
|
| 22 |
-
'hallucination',
|
| 23 |
-
'sycophancy'
|
| 24 |
]
|
| 25 |
|
| 26 |
def load_and_split_document(self, doc, chunk_size=1000, chunk_overlap=100):
|
|
|
|
| 5 |
from langchain_core.prompts import PromptTemplate
|
| 6 |
from langchain_community.document_loaders import PyPDFLoader
|
| 7 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
| 8 |
+
from prompts import *
|
| 9 |
|
| 10 |
class TestCaseGenerator:
|
| 11 |
def __init__(self, api_key=None):
|
|
|
|
| 15 |
|
| 16 |
# Predefined question types
|
| 17 |
self.available_question_types = [
|
| 18 |
+
'hallucination',
|
| 19 |
+
'conflicting_instructions',
|
| 20 |
+
'cause_and_effect_reasoning',
|
| 21 |
+
'factually_incorrect_agreement_sycophancy',
|
| 22 |
+
'toxicity'
|
|
|
|
|
|
|
| 23 |
]
|
| 24 |
|
| 25 |
def load_and_split_document(self, doc, chunk_size=1000, chunk_overlap=100):
|