mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Streamline None checking in initialize_search
This commit is contained in:
@@ -1,15 +1,13 @@
|
|||||||
# Standard Packages
|
# Standard Packages
|
||||||
import sys
|
import sys, json, yaml
|
||||||
import json
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
# External Packages
|
# External Packages
|
||||||
import uvicorn
|
import uvicorn
|
||||||
from fastapi import FastAPI, Request, Body
|
from fastapi import FastAPI, Request
|
||||||
from fastapi.responses import HTMLResponse
|
from fastapi.responses import HTMLResponse
|
||||||
from fastapi.staticfiles import StaticFiles
|
from fastapi.staticfiles import StaticFiles
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
from pydantic import BaseModel, validator
|
|
||||||
|
|
||||||
# Internal Packages
|
# Internal Packages
|
||||||
from src.search_type import asymmetric, symmetric_ledger, image_search
|
from src.search_type import asymmetric, symmetric_ledger, image_search
|
||||||
@@ -39,7 +37,8 @@ def config():
|
|||||||
|
|
||||||
@app.post('/config')
|
@app.post('/config')
|
||||||
async def config(updated_config: FullConfig):
|
async def config(updated_config: FullConfig):
|
||||||
print(updated_config)
|
to_yaml = yaml.dump(updated_config.json())
|
||||||
|
print(to_yaml)
|
||||||
return updated_config
|
return updated_config
|
||||||
|
|
||||||
@app.get('/search')
|
@app.get('/search')
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
# Standard Packages
|
# Standard Packages
|
||||||
import json
|
import json
|
||||||
import time
|
|
||||||
import gzip
|
import gzip
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import re
|
import re
|
||||||
import argparse
|
import argparse
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|||||||
Reference in New Issue
Block a user