mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Fix type declaration for the cross_encoder_model state variable. Update name of the new update API
This commit is contained in:
parent
089e4bee12
commit
a1211f40d7
3 changed files with 10 additions and 2 deletions
|
@ -334,7 +334,7 @@ async def update_chat_model(
|
|||
|
||||
@api.post("/config/data/search/model", status_code=200)
|
||||
@requires(["authenticated"])
|
||||
async def update_chat_model(
|
||||
async def update_search_model(
|
||||
request: Request,
|
||||
id: str,
|
||||
client: Optional[str] = None,
|
||||
|
|
|
@ -143,6 +143,13 @@ async def update(
|
|||
)
|
||||
return Response(content="Failed", status_code=500)
|
||||
|
||||
indexing_metadata = {
|
||||
"num_org": len(org_files),
|
||||
"num_markdown": len(markdown_files),
|
||||
"num_pdf": len(pdf_files),
|
||||
"num_plaintext": len(plaintext_files),
|
||||
}
|
||||
|
||||
update_telemetry_state(
|
||||
request=request,
|
||||
telemetry_type="api",
|
||||
|
@ -151,6 +158,7 @@ async def update(
|
|||
user_agent=user_agent,
|
||||
referer=referer,
|
||||
host=host,
|
||||
metadata=indexing_metadata,
|
||||
)
|
||||
|
||||
logger.info(f"📪 Content index updated via API call by {client} client")
|
||||
|
|
|
@ -20,7 +20,7 @@ from khoj.utils.rawconfig import FullConfig
|
|||
config = FullConfig()
|
||||
search_models = SearchModels()
|
||||
embeddings_model: Dict[str, EmbeddingsModel] = None
|
||||
cross_encoder_model: CrossEncoderModel = None
|
||||
cross_encoder_model: Dict[str, CrossEncoderModel] = None
|
||||
content_index = ContentIndex()
|
||||
openai_client: OpenAI = None
|
||||
gpt4all_processor_config: GPT4AllProcessorModel = None
|
||||
|
|
Loading…
Reference in a new issue