Skip to content

feat(chat-assistant-service): add backend service skeleton - #3912

Closed
Xiao-zhen-Liu wants to merge 10 commits into
mainfrom
feat/xiaozhen-chat-assistant-1-backend-skeleton
Closed

Xiao-zhen-Liu wants to merge 10 commits into
mainfrom
feat/xiaozhen-chat-assistant-1-backend-skeleton

Conversation

@Xiao-zhen-Liu

@Xiao-zhen-Liu Xiao-zhen-Liu commented Oct 15, 2025 •

Copy link
Copy Markdown
Contributor

Purpose

Refer to #3915 for the design and plan of adding the new chat assistant service.

This PR adds the basic project skeleton for the backend web server of chat assistant service. Within the scope of this PR, the service only provides a health check endpoint. It sets up the proper structure for subsequent PRs, which will add WebSocket communication, LLM agent orchestration, etc.

Changes

Project Configuration:

  • Add pyproject.toml with configurations for linter and formatter, and pytest. We use this file as a central place for tool configs.
  • Add requirements.txt with dependencies needed for this PR (FastAPI, Uvicorn, pytest). Subsequent PRs will gradually add more dependencies.
  • Configure Python 3.12 as target version

Backend Service:

  • Add FastAPI application with health check endpoint at /api/healthcheck
  • Add service entry point with Uvicorn server (port 8001)

Testing:

  • Add unit tests for app creation and health check endpoint
  • Tests use pytest with FastAPI TestClient

CI:

  • Add a new GitHub Actions job chat_assistant_service to build pipeline.
  • Runs the formatter, linter and unit tests.

Project Structure

chat-assistant-service/
  ├── src/
  │   ├── main.py  # Entry point of the service
  │   └── app/
  │       ├── __init__.py
  │       └── create_app.py  # FastAPI app factory
  │
  ├── tests/          # Unit tests
  │   └── app/
  │       └── test_health_check.py
  │
  ├── requirements.txt  # Dependencies
  ├── pyproject.toml  # Only used for Black (formatter) and Flake8 (linter) configurations
  ├── pytest.ini           # pytest configurations

Testing Locally

Expected behavior: the new web server works and healtcheck is successful.

Step 1: Configure environment and dependencies

  • Create and activate a new python virtual environment for this microservice (e.g., name it texera-chat-assistant-service) with Python version >= 3.12
  • Inside ./chat-assistant-service, run pip install -r requirements.txt

Step 2: Run Service

Step 3: Test Health Check

  • In another terminal, execute curl http://localhost:8001/api/healthcheck. You can also visit http://localhost:8001/api/healthcheck in browser.
  • Expected output: {"status":"ok"}

@github-actions github-actions Bot added feature dependencies Pull requests that update a dependency file pyamber ci changes related to CI service labels Oct 15, 2025
@Xiao-zhen-Liu
Xiao-zhen-Liu marked this pull request as ready for review October 16, 2025 20:33
@Xiao-zhen-Liu Xiao-zhen-Liu self-assigned this Oct 16, 2025
Comment thread chat-assistant-service/.gitignore Resolved
@Yicong-Huang

Yicong-Huang commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor

in your code, tests is in app. can we move it out? I also suggest you add app into a src folder`, and make test folder structure mapped to src folder structure:


  ├── src/
  │   ├──app/
  ├── test/
  │   └──app/   # contains tests regarding app
  │   └──── test_health_check.py   # Unit tests

Comment thread chat-assistant-service/pyproject.toml Resolved
@Yicong-Huang

Yicong-Huang commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor

please avoid using [[chat-assistant-service][1] this syntax.

  1. we have agreed to follow conversional commits, you can use feat(chat-assistant-service)
  2. it is generally not a good idea to label 1, 2, 3 in PRs, as this is a shared repo, your [2] != other's [2], could be confusing.

please feel free to use projects and labels to add useful information.

@Xiao-zhen-Liu Xiao-zhen-Liu changed the title feat: [chat-assistant-service][1] add backend service skeleton feat(chat-assistant-service) add backend service skeleton Oct 17, 2025
@Xiao-zhen-Liu Xiao-zhen-Liu changed the title feat(chat-assistant-service) add backend service skeleton feat(chat-assistant-service): add backend service skeleton Oct 17, 2025
Comment thread chat-assistant-service/requirements.txt Resolved
@Xiao-zhen-Liu

Xiao-zhen-Liu commented Oct 20, 2025 •

Copy link
Copy Markdown
Contributor Author

in your code, tests is in app. can we move it out? I also suggest you add app into a src folder`, and make test folder structure mapped to src folder structure:


  ├── src/
  │   ├──app/
  ├── test/
  │   └──app/   # contains tests regarding app
  │   └──── test_health_check.py   # Unit tests

I restructured the project according to your suggestions. Note additional pytest settings needed to be added in pyproject.toml for this structure to work.


[tool.pytest.ini_options]
addopts = "-q"
pythonpath = ["src"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is pythonpath = ["src"] meant for the pytest-pythonpath plugin?
If so, I don’t see that plugin in the dependencies. Should we add it?

@Xiao-zhen-Liu

Copy link
Copy Markdown
Contributor Author

We have decided to merge another prototype instead of this one, so I will close this PR.

@Xiao-zhen-Liu
Xiao-zhen-Liu deleted the feat/xiaozhen-chat-assistant-1-backend-skeleton branch May 1, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci changes related to CI dependencies Pull requests that update a dependency file feature pyamber service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants