DEV Community

parmarjatin4911@gmail.com
parmarjatin4911@gmail.com

Posted on

AutoLLM API

AutoLLM API

from autollm import AutoQueryEngine
from llama_index import SimpleDirectoryReader
import uvicorn
from autollm import AutoFastAPI

documents = SimpleDirectoryReader('data').load_data()

query_engine = AutoQueryEngine.from_parameters(
documents = documents
)

app = AutoFastAPI.from_query_engine(query_engine)

@app.get("/")
async def read_query(q: str):
return query_engine.query(q)

if name == "main":
uvicorn.run(app, host="0.0.0.0", port=8000)

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay