feat(vocero): add linked content and TALKFIRST greetings (#2)
Opening a report or podcast link now establishes an authenticated starting reference for the conversation. Users can select other accessible content or compare reports while retaining the original link, and TALKFIRST greetings can name the verified report or podcast. Release notes: - Added authenticated report and episode link resolution with bounded lookups and unavailable-content handling - Added explicit conversation selection without restricting searches or changing the reference during comparisons - Added contextual TALKFIRST greetings through both voice-proxy and HTTP reasoning paths - Preserved backend permission checks, conversation isolation, cancellation, and the existing speech protocol Reviewed-on: AquaPortal/s2s#2
This commit is contained in:
@@ -10,8 +10,7 @@ from fastapi.responses import JSONResponse
|
||||
from vocero_api.core import config as settings
|
||||
from vocero_api.models.mcp import IntegrationError
|
||||
from vocero_api.models.requests import ReasoningRequest
|
||||
from vocero_api.providers import mcp
|
||||
from vocero_api.services import conversations, mcp_tools
|
||||
from vocero_api.services import content_context, conversations, mcp_tools
|
||||
|
||||
|
||||
async def response_text(messages: list[dict[str, str]], headers: dict[str, str]) -> str:
|
||||
@@ -34,20 +33,21 @@ async def response_text(messages: list[dict[str, str]], headers: dict[str, str])
|
||||
async def run_turn(
|
||||
req: ReasoningRequest, conversation: conversations.Conversation, turn: mcp_tools.ToolTurn, headers: dict[str, str]
|
||||
) -> str:
|
||||
catalog = await mcp.discover(conversation.backend_token)
|
||||
catalog = await content_context.catalog(conversation.backend_token)
|
||||
turn.require_current()
|
||||
conversation.catalog = catalog
|
||||
base = settings.S2S_PRIMARY_PROMPT or req.instructions
|
||||
prior = [message for previous_turn in conversation.history for message in previous_turn]
|
||||
notes = f"User-provided reference notes:\n{req.user_context[:12000]}\n\n" if req.user_context else ""
|
||||
current = [{"role": "user", "content": notes + req.transcript.strip()}]
|
||||
system = {"role": "system", "content": mcp_tools.instructions(base, conversation)}
|
||||
while True:
|
||||
system = {"role": "system", "content": mcp_tools.instructions(base, conversation)}
|
||||
answer = await response_text([system, *prior, *current], headers)
|
||||
turn.require_current()
|
||||
chosen = mcp_tools.selection(answer)
|
||||
current.append({"role": "assistant", "content": answer})
|
||||
if chosen is None:
|
||||
conversation.greeting_pending = False
|
||||
conversation.history.append(current)
|
||||
while (
|
||||
len(conversation.history) > 6
|
||||
|
||||
Reference in New Issue
Block a user