fix(librarian): expose page_id in wiki search results
search_wiki printed ordinally numbered results with no page ID while get_wiki_page demands 'the page ID from search results' - the model passed the list position (page 1) and 404'd. Results now carry page_id and drop the ordinals. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -246,11 +246,14 @@ async def search_wiki(
|
|||||||
|
|
||||||
output_parts = [f"## Wiki Search: {query}\n"]
|
output_parts = [f"## Wiki Search: {query}\n"]
|
||||||
|
|
||||||
for i, page in enumerate(results, 1):
|
# No ordinal numbering: small models pass the list position to
|
||||||
output_parts.append(f"{i}. **{page.title}**")
|
# get_wiki_page instead of the page ID unless the ID is the only
|
||||||
output_parts.append(f" Path: {page.path}")
|
# number in sight.
|
||||||
|
for page in results:
|
||||||
|
output_parts.append(f"- **{page.title}** (page_id: {page.id})")
|
||||||
|
output_parts.append(f" Path: {page.path}")
|
||||||
if page.description:
|
if page.description:
|
||||||
output_parts.append(f" {page.description}")
|
output_parts.append(f" {page.description}")
|
||||||
output_parts.append("")
|
output_parts.append("")
|
||||||
|
|
||||||
return "\n".join(output_parts)
|
return "\n".join(output_parts)
|
||||||
|
|||||||
Reference in New Issue
Block a user