This commit is contained in:
Jason
2023-09-13 21:59:38 -04:00
parent 9651a09b17
commit 8610202e21
4 changed files with 4 additions and 6 deletions
+1 -2
View File
@@ -1,5 +1,5 @@
from .function_calls import OpenAISchema, openai_function, openai_schema
from .dsl import MultiTask, Maybe, Validator, llm_validator, CitationMixin
from .dsl import MultiTask, Maybe, llm_validator, CitationMixin
from .patch import patch
__all__ = [
@@ -10,6 +10,5 @@ __all__ = [
"Maybe",
"openai_schema",
"patch",
"Validator",
"llm_validator",
]
-1
View File
@@ -64,7 +64,6 @@ class CitationMixin(BaseModel):
If the span is not found, remove the substring_phrase from the list.
"""
if info.context is None:
logger.info("No context found, skipping validation")
return self
# Get the context from the info
+1 -1
View File
@@ -118,7 +118,7 @@ def MultiTask(
new_cls = create_model(
name,
tasks=list_tasks,
__base__=(OpenAISchema, MultiTaskBase),
__base__=(OpenAISchema, MultiTaskBase), # type: ignore
)
# set the class constructor BaseModel
new_cls.task_type = subtask_class
+2 -2
View File
@@ -103,13 +103,13 @@ def wrap_chatcompletion(func: Callable) -> Callable:
@wraps(func)
async def new_chatcompletion_async(
response_model=None, valiation_context=None, *args, max_retries=0, **kwargs
response_model=None, validation_context=None, *args, max_retries=0, **kwargs
):
response_model, new_kwargs = handle_response_model(response_model, kwargs) # type: ignore
response, error = await retry_async(
func=func,
response_model=response_model,
valiation_context=valiation_context,
validation_context=validation_context,
max_retries=max_retries,
args=args,
kwargs=new_kwargs,