mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Streamline None checking in initialize_search
This commit is contained in:
parent
bf8ae31e6a
commit
5b80b87379
2 changed files with 4 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue