Skip to content

davis118/AskTemoc_Backend

Repository files navigation

AskTemoc_Backend


Requirements

  • Python 3.13+
  • ollama installed and running (for future integration, currently mocked)
  • pip (Python package installer)
  • Git

Clone the Repository

git clone https://github.com/Conwenu/AskTemoc_Backend.git
cd path/to/project-root

Install Dependencies

Make sure you're in a virtual environment:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

Install required packages:

pip install -r requirements.txt

Make Sure Ollama is Installed

Ensure ollama is installed and running locally.

ollama run llama3  # Or any other model you plan to use

Run the FastAPI Server

You can start the server using:

uvicorn app.main:app --reload

Test the /api/query Endpoint

You can test using curl, Thunder Client Extension, Postman, or directly in Swagger UI.

Endpoint: GET /api/query/

Query Parameter: query

Example Request

Using curl:

curl -X POST "http://127.0.0.1:8000/api/query/" \
  -H "Content-Type: application/json" \
  -d '{"query": "What is FastAPI?"}'

Example Response

{
  "answer": "Answer: What is FastAPI?"
}

Or if you have successfully installed Ollama with the llama3.1:8b model

{
  "answer": "The capital of China is Beijing."
}

Webscraper Setup

If you haven’t already installed the Crawl4AI library (it should be listed in requirements.txt), run:

pip install crawl4ai

After installing dependencies, run:

crawl4ai-setup

Then verify the installation with:

crawl4ai-doctor

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6

Languages