-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
184 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 🚧 WIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
FROM golang:1.23.1-alpine AS builder | ||
|
||
WORKDIR /app | ||
COPY main.go . | ||
COPY go.mod . | ||
|
||
RUN <<EOF | ||
go mod tidy | ||
go build -o web-chat-bot | ||
EOF | ||
# Copy the entire parakeet project | ||
COPY . . | ||
|
||
# Move to the backend directory | ||
WORKDIR /app/examples/69-web-chat-bot/backend | ||
|
||
# Update go.mod to point to the root of the copied parakeet code | ||
RUN go mod edit -replace github.com/parakeet-nest/parakeet=/app | ||
|
||
# Build the application | ||
RUN go mod download | ||
RUN go build -o web-chat-bot | ||
|
||
FROM scratch | ||
WORKDIR /app | ||
COPY --from=builder /app/web-chat-bot . | ||
COPY --from=builder /app/examples/69-web-chat-bot/backend/web-chat-bot . | ||
|
||
CMD ["./web-chat-bot"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ go 1.23.1 | |
|
||
require github.com/parakeet-nest/parakeet v0.2.4 | ||
|
||
replace github.com/parakeet-nest/parakeet => ../../.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
This is my project | ||
|
||
parakeet/ | ||
├── examples/ | ||
│ └── 69-web-chat-bot/ | ||
│ └── backend | ||
│ ├── Dockerfile | ||
│ ├── main.go | ||
│ └── go.mod | ||
├── cli/ | ||
├── content/ | ||
├── data/ | ||
├── db/ | ||
├── embeddings/ | ||
├── enums/ | ||
├── flock/ | ||
├── gear/ | ||
├── history/ | ||
├── llm/ | ||
├── mcphelpers/ | ||
├── prompt/ | ||
├── similarity/ | ||
├── tools/ | ||
├── wasm/ | ||
├── completion/ | ||
└── parakeet.go | ||
|
||
|
||
the main file of the library is parakeet.go | ||
|
||
the example of code is in parakeet/examples/69-web-chat-bot/backend | ||
|
||
the other directories are the package of the library | ||
|
||
this is my current Dockerfile: | ||
|
||
``` | ||
FROM golang:1.23.1-alpine AS builder | ||
WORKDIR /app | ||
COPY main.go . | ||
COPY go.mod . | ||
|
||
RUN <<EOF | ||
go mod tidy | ||
go build -o web-chat-bot | ||
EOF | ||
|
||
FROM scratch | ||
WORKDIR /app | ||
COPY --from=builder /app/web-chat-bot . | ||
|
||
CMD ["./web-chat-bot"] | ||
``` | ||
and this is the go.mod file | ||
|
||
``` | ||
module 69-web-chat-bot | ||
|
||
go 1.23.1 | ||
|
||
require github.com/parakeet-nest/parakeet v0.2.4 | ||
|
||
replace github.com/parakeet-nest/parakeet => ../../.. | ||
``` | ||
|
||
I need to dockerize the backend example, how can I handle `replace github.com/parakeet-nest/parakeet => ../../..` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 🚧 WIP |
15 changes: 15 additions & 0 deletions
15
examples/69-web-chat-bot/backup/production/backend/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM golang:1.23.1-alpine AS builder | ||
WORKDIR /app | ||
COPY main.go . | ||
COPY go.mod . | ||
|
||
RUN <<EOF | ||
go mod tidy | ||
go build -o web-chat-bot | ||
EOF | ||
|
||
FROM scratch | ||
WORKDIR /app | ||
COPY --from=builder /app/web-chat-bot . | ||
|
||
CMD ["./web-chat-bot"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module 69-web-chat-bot | ||
|
||
go 1.23.1 | ||
|
||
require github.com/parakeet-nest/parakeet v0.2.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
services: | ||
# docker compose -f compose.local.yml up --build | ||
|
||
download-local-llm: | ||
image: curlimages/curl:8.6.0 | ||
entrypoint: ["curl", "http://host.docker.internal:11434/api/pull", "-d", '{"name": "qwen2.5:3b"}'] | ||
|
||
|
||
backend: | ||
build: | ||
context: ./backend | ||
dockerfile: Dockerfile | ||
environment: | ||
- OLLAMA_BASE_URL=http://host.docker.internal:11434 | ||
- LLM_CHAT=qwen2.5:3b | ||
depends_on: | ||
download-local-llm: | ||
condition: service_completed_successfully | ||
develop: | ||
watch: | ||
- action: rebuild | ||
path: ./backend/main.go | ||
|
||
|
||
frontend: | ||
build: | ||
context: ./frontend | ||
dockerfile: Dockerfile | ||
ports: | ||
- 9090:8501 | ||
environment: | ||
- BACKEND_SERVICE_URL=http://backend:5050 | ||
- PAGE_TITLE=🙂🤓🥸 We are Bob! | ||
- PAGE_HEADER=We are legion 🤖🤖🤖 | ||
- PAGE_ICON=🤖 | ||
depends_on: | ||
- backend | ||
develop: | ||
watch: | ||
- action: rebuild | ||
path: ./frontend/app.py | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 🚧 WIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
---------------------------------- | ||
add SessionId to llm.MessageRecord | ||
---------------------------------- | ||
|
||
---------------------------------- | ||
update the other methods to take | ||
in account the id of session | ||
---------------------------------- | ||
|
||
---------------------------------- | ||
implement: | ||
---------------------------------- | ||
- GetFiltered(patternId string) ([]llm.MessageRecord, error) | ||
- GetFilteredMessages(patternId string) ([]llm.Message, error) | ||
- RemoveMessage(id string) | ||
- RemoveFilteredMessages(patternId string) | ||
- RemoveAllMessages() | ||
|
||
---------------------------------- | ||
Add Daphnia support | ||
---------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters