Skip to content

Commit 59eb541

Browse files
authored
Release Candidate v4.10.0 (#277)
2 parents 25d5cca + dec0796 commit 59eb541

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1128
-536
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.7.0
1+
4.10.0

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
FROM python:3.12.6-alpine
1+
FROM python:3.12.6-slim
22

3-
# Install system dependencies, build dependencies, and pipenv
4-
RUN apk add --no-cache libffi openssl ca-certificates ffmpeg \
5-
&& apk add --no-cache --virtual .build-deps make clang-dev gcc g++ musl-dev \
3+
# Install system dependencies and pipenv
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
libffi8 libssl3 ca-certificates ffmpeg \
6+
&& rm -rf /var/lib/apt/lists/* \
67
&& pip install --no-cache-dir pipenv
78

89
# Set up working directory
@@ -14,7 +15,9 @@ RUN mv .github/ISSUE_TEMPLATE src/templates && rm -rf .github
1415

1516
# Install the dependencies
1617
RUN pipenv install --deploy --ignore-pipfile --verbose \
17-
&& apk del .build-deps
18+
&& find /usr/local/lib/python3.12 -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true \
19+
&& find /usr/local/lib/python3.12 -type f -name "*.pyc" -delete \
20+
&& rm -rf /root/.cache/pip /root/.cache/pipenv
1821

1922
# Set the entrypoint command
2023
CMD ["sh", "tools/run_prod.sh"]

Pipfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ alembic = "*"
1212
pydantic = "*"
1313
uvicorn = "*"
1414
replicate = "*"
15-
ruff = "*"
1615
pydub = "*"
1716
pymupdf = "*"
1817
python-jose = { extras = ["cryptography"], version = "*" }
@@ -35,10 +34,12 @@ readabilipy = "*"
3534
langchain-perplexity = "*"
3635
google-genai = "*"
3736
pyuploadcare = "*"
37+
pillow = "*"
3838

3939
[dev-packages]
4040
pytest = "*"
4141
requests-mock = "*"
42+
ruff = "*"
4243

4344
[requires]
4445
# Python 3.12: keep in sync with pyproject.toml

Pipfile.lock

Lines changed: 375 additions & 465 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/.env

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
# This is for local testing only. The real app is deployed with random rotating credentials.
2-
3-
# DB Config
1+
# Minimal configuration for local Docker testing
2+
# For production, set proper values for all secrets
43

4+
# Database (required)
55
POSTGRES_HOST=db
66
POSTGRES_DB=agent
77
POSTGRES_USER=root
88
POSTGRES_PASS=root
9-
POSTGRES_HOST_AUTH_METHOD=trust
10-
11-
# Interaction config
129

10+
# API Authentication (required)
1311
API_KEY=developer
14-
MAX_SPONSORSHIPS_PER_USER=2
15-
WEBSITE_URL=https://the-agent.appifyhub.com
16-
# etc...
1712

18-
# Service config
19-
20-
VERBOSE=true
21-
WEB_RETRIES=3
22-
WEB_RETRY_DELAY_S=1
23-
WEB_TIMEOUT_S=10
13+
# Path configuration (required for Docker)
2414
THE_AGENT_ISSUE_TEMPLATES_PATH=/app/src/templates
25-
# etc...
15+
16+
# Optional: Override defaults if needed
17+
# LOG_LEVEL=debug
18+
# MAX_USERS=100
19+
# WEBSITE_URL=https://the-agent.appifyhub.com

docs/open-api-users.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,17 @@ components:
704704
nullable: false
705705
enum: [none, major, minor, all]
706706
description: Release notification settings
707+
media_mode:
708+
type: string
709+
nullable: false
710+
enum: [photo, file, all]
711+
description: Media sending mode - photo (send as photo), file (send as file), all (send both photo and file)
707712
required:
708713
- language_name
709714
- language_iso_code
710715
- reply_chance_percent
711716
- release_notifications
717+
- media_mode
712718

713719
ChatSettingsResponse:
714720
type: object
@@ -745,6 +751,11 @@ components:
745751
nullable: false
746752
enum: [none, major, minor, all]
747753
description: Release notification settings
754+
media_mode:
755+
type: string
756+
nullable: false
757+
enum: [photo, file, all]
758+
description: Media sending mode - photo (send as photo), file (send as file), all (send both photo and file)
748759
is_private:
749760
type: boolean
750761
nullable: false
@@ -758,6 +769,7 @@ components:
758769
- platform
759770
- reply_chance_percent
760771
- release_notifications
772+
- media_mode
761773
- is_private
762774
- is_own
763775

src/api/mapper/chat_mapper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def domain_to_api(chat: ChatConfig, is_own: bool) -> ChatSettingsResponse:
1111
language_iso_code = chat.language_iso_code,
1212
reply_chance_percent = chat.reply_chance_percent,
1313
release_notifications = chat.release_notifications.value,
14+
media_mode = chat.media_mode.value,
1415
is_private = chat.is_private,
1516
is_own = is_own,
1617
)

src/api/model/chat_settings_payload.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ class ChatSettingsPayload(BaseModel):
88
language_iso_code: str
99
reply_chance_percent: int
1010
release_notifications: str
11+
media_mode: str
1112

1213
# noinspection PyNestedDecorators
1314
@field_validator(
1415
"language_name",
1516
"language_iso_code",
1617
"release_notifications",
18+
"media_mode",
1719
mode = "before",
1820
)
1921
@classmethod

src/api/model/chat_settings_response.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ class ChatSettingsResponse(BaseModel):
99
language_iso_code: str | None = None
1010
reply_chance_percent: int
1111
release_notifications: str
12+
media_mode: str
1213
is_private: bool
1314
is_own: bool

src/api/settings_controller.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ def save_chat_settings(self, chat_id: str, payload: ChatSettingsPayload):
147147
log.t(f" Updating release notifications to '{release_notifications.value}'")
148148
chat_config_save.release_notifications = release_notifications
149149

150+
# validate media mode changes
151+
media_mode = ChatConfigDB.MediaMode.lookup(payload.media_mode)
152+
if not media_mode:
153+
raise ValueError(log.e(f"Invalid media mode setting value '{payload.media_mode}'"))
154+
log.t(f" Updating media mode to '{media_mode.value}'")
155+
chat_config_save.media_mode = media_mode
156+
150157
# finally store the changes
151158
ChatConfig.model_validate(self.__di.chat_config_crud.save(chat_config_save))
152159
log.i("Chat settings saved")

0 commit comments

Comments
 (0)