diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml deleted file mode 100644 index 477fa8a..0000000 --- a/.gitea/workflows/demo.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] - -jobs: - Explore-Gitea-Actions: - runs-on: home - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file diff --git a/agent-api/Dockerfile b/agent-api/Dockerfile new file mode 100644 index 0000000..9d07a1c --- /dev/null +++ b/agent-api/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.11-slim + +WORKDIR /app + +COPY requirements.txt . + +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/agent-api/app.py b/agent-api/app.py new file mode 100644 index 0000000..2753e08 --- /dev/null +++ b/agent-api/app.py @@ -0,0 +1,37 @@ +from fastapi import FastAPI +from openai import OpenAI +import os + +app = FastAPI() + +# DeepSeek OpenAI-compatible endpoint +client = OpenAI( + api_key=os.getenv("DEEPSEEK_API_KEY"), + base_url="https://api.deepseek.com" +) + +@app.post("/v1/chat/completions") +async def chat(data: dict): + + messages = data["messages"] + + repo_context = """ + This assistant has access to the repository. + Help the user understand the codebase. + This repo is building an chatbot, currently still in early stages. The main files are: + - app.py: The main FastAPI application that defines the API endpoints and integrates with the Deep seek API. + - agent.py: Contains the logic for the chatbot agent, including how it processes messages and generates responses. + """ + + messages.insert(0, { + "role": "system", + "content": repo_context + }) + + response = client.chat.completions.create( + model="deepseek-v4-flash", + messages=messages, + temperature=0.3 + ) + + return response.model_dump() \ No newline at end of file diff --git a/agent-api/requirements.txt b/agent-api/requirements.txt new file mode 100644 index 0000000..4e42a51 --- /dev/null +++ b/agent-api/requirements.txt @@ -0,0 +1,3 @@ +fastapi +openai +uvicorn \ No newline at end of file