mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-18 15:52:10 +00:00
Apply conversation bot improvements (proto-improvements)
Diff vs working-copy baseline = exactly this session's bot edits: - constants.py: env-var config, safe JSON loading, optional-dependency guards, env->netrc token resolution, API_SHARED_KEY + service_headers() - communication_subroutine.py: queue get(timeout) + Empty handling, daemon threads, cooperative stop_event, inbound _authorize_request() - bot.py: single asyncio event loop with cooperative shutdown - music_functions / radio_commands / librarian_commands: send X-Conjurer-Api-Key on internal HTTP calls via service_headers() Musician runtime data overlay dropped; conjurer_musician/.gitignore now keeps generated playlists/mp3 out of the repo. The 1+2+3 musician code port already lives in the base conjurer_musician. Depends on #9: must merge after restructure/working-copy-root. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,9 @@ from discord.ext import commands, tasks
|
||||
|
||||
from ai_functions import handle_response
|
||||
from communication_subroutine import IN_COMM_Q, OUT_COMM_Q, QueryControl
|
||||
from constants import DIR_PATH_SADOX, LIBRARIAN_SERVICE_ADDRESS, SEND_QUERY
|
||||
from constants import DIR_PATH_SADOX, LIBRARIAN_SERVICE_ADDRESS, SEND_QUERY, service_headers
|
||||
|
||||
SERVICE_HEADERS = service_headers()
|
||||
|
||||
|
||||
class DataModule(commands.Cog):
|
||||
@@ -165,6 +167,7 @@ class DataModule(commands.Cog):
|
||||
requests.post,
|
||||
f"{LIBRARIAN_SERVICE_ADDRESS}{SEND_QUERY}",
|
||||
json=json_query,
|
||||
headers=SERVICE_HEADERS,
|
||||
timeout=360,
|
||||
)
|
||||
await ctx.send(
|
||||
@@ -260,6 +263,7 @@ class DataModule(commands.Cog):
|
||||
requests.post,
|
||||
f"{LIBRARIAN_SERVICE_ADDRESS}{SEND_QUERY}",
|
||||
json=json_query,
|
||||
headers=SERVICE_HEADERS,
|
||||
timeout=360,
|
||||
)
|
||||
await ctx.send(
|
||||
|
||||
Reference in New Issue
Block a user