Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Sync parameter with LLM pipeline default #998

davidmezzetti1d7b6a98c905
diff --git a/src/python/txtai/api/routers/llm.py b/src/python/txtai/api/routers/llm.py
index e9d5d45a..f30bb9d0 100644
--- a/src/python/txtai/api/routers/llm.py
+++ b/src/python/txtai/api/routers/llm.py
@@ -14,7 +14,7 @@ router = APIRouter(route_class=EncodingAPIRoute)
@router.get("/llm")
-def llm(text: str, maxlength: Optional[int] = None, stream: Optional[bool] = False, stripthink: Optional[bool] = False):
+def llm(text: str, maxlength: Optional[int] = None, stream: Optional[bool] = False, stripthink: Optional[bool] = None):
"""
Runs a LLM pipeline for the input text.
@@ -22,6 +22,7 @@ def llm(text: str, maxlength: Optional[int] = None, stream: Optional[bool] = Fal
text: input text
maxlength: optional response max length
stream: streams response if True
+ stripthink: strip thinking tags if True
Returns:
response text
@@ -43,7 +44,7 @@ def batchllm(
texts: List[str] = Body(...),
maxlength: Optional[int] = Body(default=None),
stream: Optional[bool] = Body(default=False),
- stripthink: Optional[bool] = Body(default=False),
+ stripthink: Optional[bool] = Body(default=None),
):
"""
Runs a LLM pipeline for the input texts.
@@ -52,6 +53,7 @@ def batchllm(
texts: input texts
maxlength: optional response max length
stream: streams response if True
+ stripthink: strip thinking tags if True
Returns:
response texts
diff --git a/src/python/txtai/api/routers/rag.py b/src/python/txtai/api/routers/rag.py
index c8f68041..2173d2e5 100644
--- a/src/python/txtai/api/routers/rag.py
+++ b/src/python/txtai/api/routers/rag.py
@@ -14,7 +14,7 @@ router = APIRouter(route_class=EncodingAPIRoute)
@router.get("/rag")
-def rag(query: str, maxlength: Optional[int] = None, stream: Optional[bool] = False, stripthink: Optional[bool] = False):
+def rag(query: str, maxlength: Optional[int] = None, stream: Optional[bool] = False, stripthink: Optional[bool] = None):
"""
Runs a RAG pipeline for the input query.
@@ -22,6 +22,7 @@ def rag(query: str, maxlength: Optional[int] = None, stream: Optional[bool] = Fa
query: input RAG query
maxlength: optional response max length
stream: streams response if True
+ stripthink: strip thinking tags if True
Returns:
answer
@@ -43,7 +44,7 @@ def batchrag(
queries: List[str] = Body(...),
maxlength: Optional[int] = Body(default=None),
stream: Optional[bool] = Body(default=False),
- stripthink: Optional[bool] = Body(default=False),
+ stripthink: Optional[bool] = Body(default=None),
):
"""
Runs a RAG pipeline for the input queries.
@@ -52,6 +53,7 @@ def batchrag(
queries: input RAG queries
maxlength: optional response max length
stream: streams response if True
+ stripthink: strip thinking tags if True
Returns:
answers