removed bunch of old code, added /init bunch of cleanups
Build and Push Agent API / build (push) Successful in 4s
Build and Push Agent API / build (push) Successful in 4s
This commit is contained in:
@@ -84,9 +84,9 @@ THEMES = {
|
||||
"airplane", "plane", "flight", "pilot", "cockpit", "turbulence"
|
||||
],
|
||||
"persona": (
|
||||
"mention airplane noises, and say that Erwin will be terrified "
|
||||
"mention something airplane related, and hope Erwin is not around to see this reference."
|
||||
"Stay fully functional — carry out all requested actions normally, but only if something is requested"
|
||||
"Mention airplane noises, and say that Erwin will be terrified. "
|
||||
"Mention something airplane related, and hope Erwin is not around to see this reference. "
|
||||
"Stay fully functional — carry out all requested actions normally, but only if something is requested."
|
||||
)
|
||||
},
|
||||
|
||||
@@ -95,9 +95,9 @@ THEMES = {
|
||||
"unable to read", "dyslexia", "dislexia", "dislexic", "dyslexic", "typo", "trouble reading", "misspelled", "misspelling"
|
||||
],
|
||||
"persona": (
|
||||
"mention that tim is dyslexic and has trouble reading in the response "
|
||||
"mention it is sometimes difficult to read, since the creator (which is Tim) of this agent is dyslexic. "
|
||||
"Stay fully functional — carry out all requested actions normally, but only if something is requested"
|
||||
"Mention that Tim is dyslexic and has trouble reading in the response. "
|
||||
"Mention it is sometimes difficult to read, since the creator (Tim) of this agent is dyslexic. "
|
||||
"Stay fully functional — carry out all requested actions normally, but only if something is requested."
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+6
-25
@@ -565,26 +565,12 @@ async def _discover(args: dict) -> ToolResult:
|
||||
r.raise_for_status()
|
||||
results = r.json().get("results", [])
|
||||
desc = genre
|
||||
elif studio:
|
||||
# /discover/studio/{studioId} requires a numeric TMDB studio ID.
|
||||
# Fall back to searching by name via /search.
|
||||
desc = studio
|
||||
search_query = studio
|
||||
elif studio or keyword:
|
||||
# Both use /search with free-text query (studio needs a numeric TMDB
|
||||
# studio ID not available here, so fall back to name search).
|
||||
desc = studio or keyword
|
||||
endpoint = "/api/v1/search"
|
||||
params["query"] = search_query
|
||||
if language:
|
||||
params["language"] = language
|
||||
async with _client() as c:
|
||||
r = await c.get(endpoint, params=params)
|
||||
r.raise_for_status()
|
||||
results = r.json().get("results", [])
|
||||
# Filter to requested media type
|
||||
results = [item for item in results if item.get("mediaType") == kind]
|
||||
elif keyword:
|
||||
# Free-text keyword → use /search, filtered by mediaType
|
||||
desc = keyword
|
||||
endpoint = "/api/v1/search"
|
||||
params["query"] = keyword
|
||||
params["query"] = desc
|
||||
if language:
|
||||
params["language"] = language
|
||||
async with _client() as c:
|
||||
@@ -616,7 +602,6 @@ async def _request_media(args: dict) -> ToolResult:
|
||||
async with _client() as c:
|
||||
# --- Fast-path: TMDb ID known — confirm the title and request directly ---
|
||||
if tmdb_id:
|
||||
# Quick lookup to get the correct title for the confirmation message
|
||||
detail_r = await c.get(f"/api/v1/{kind}/{tmdb_id}")
|
||||
if detail_r.status_code == 200:
|
||||
detail = detail_r.json()
|
||||
@@ -626,11 +611,6 @@ async def _request_media(args: dict) -> ToolResult:
|
||||
or detail.get("firstAirDate", "")[:4]
|
||||
or "?"
|
||||
)
|
||||
else:
|
||||
# Detail lookup failed — fall back to title search
|
||||
pass
|
||||
|
||||
if detail_r.status_code == 200:
|
||||
# Submit directly with the known TMDb ID
|
||||
request_body: dict = {"mediaType": kind, "mediaId": tmdb_id}
|
||||
if kind == "tv":
|
||||
@@ -651,6 +631,7 @@ async def _request_media(args: dict) -> ToolResult:
|
||||
f"❌ Failed to request **{media_title}** ({media_year}). "
|
||||
f"Seerr responded with status {req_r.status_code}: {req_r.text[:500]}"
|
||||
)
|
||||
# Detail lookup failed — fall through to slow-path title search
|
||||
|
||||
# --- Slow-path: search by title ---
|
||||
r = await c.get("/api/v1/search", params={"query": quote(title), "page": 1})
|
||||
|
||||
Reference in New Issue
Block a user