💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Make texts parameter optional for extractor pipeline in applications, closes #420
davidmezzetti5251777f63e1
diff --git a/src/python/txtai/api/routers/extractor.py b/src/python/txtai/api/routers/extractor.pyindex f5eb71c4..011a9097 100644--- a/src/python/txtai/api/routers/extractor.py+++ b/src/python/txtai/api/routers/extractor.py@@ -2,7 +2,7 @@Defines API paths for extractor endpoints."""-from typing import List+from typing import List, Optionalfrom fastapi import APIRouter, Body@@ -12,13 +12,13 @@ router = APIRouter()@router.post("/extract")-def extract(queue: List[dict] = Body(...), texts: List[str] = Body(...)):+def extract(queue: List[dict] = Body(...), texts: Optional[List[str]] = Body(default=None)):"""Extracts answers to input questions.Args:queue: list of {name: value, query: value, question: value, snippet: value}- texts: list of text+ texts: optional list of textReturns:list of {name: value, answer: value}diff --git a/src/python/txtai/app/base.py b/src/python/txtai/app/base.pyindex 7983a432..4b31a80e 100644--- a/src/python/txtai/app/base.py+++ b/src/python/txtai/app/base.py@@ -561,13 +561,13 @@ class Application:return None- def extract(self, queue, texts):+ def extract(self, queue, texts=None):"""Extracts answers to input questions.Args:queue: list of {name: value, query: value, question: value, snippet: value}- texts: list of text+ texts: optional list of textReturns:list of {name: value, answer: value}