Skip to content

Conversation

@robotdad
Copy link
Member

@robotdad robotdad commented Aug 8, 2025

NOTE: The example changed here to show the functionality will be removed, I just needed a place to test. I took the opportunity to refresh the ai_context and add some Claude Code commands as well.

Backend:

  • workbench-service/semantic_workbench_service/controller/assistant.py
    • New method: AssistantController.get_processed_file_content(...)
  • API model (added/updated): workbench_model.py (ProcessedFileContentModel)

Frontend:

  • workbench-app/src/models/ProcessedFileContent.ts (TS mirror)
  • Hook usage: workbench-app/src/libs/useWorkbenchService.ts (getProcessedFileContentAsync)

Method Behavior (assistant.py)

  • Auth: Ensures principal can access assistant and that assistant is in the conversation.
  • Derives state_id: file_content_ (slashes/spaces -> underscores).
  • Calls assistant_client.get_state(conversation_id, state_id).
  • Returns:
    • success: content + content_type + metadata
    • not_available: markdown guidance (assistant hasn’t exposed state)
    • error: processing_status=error + error_message (non-404 AssistantError)
  • No file existence or collision guarantees (intentionally scoped small).

Route (read implementation in service.py)
GET /conversations/{conversation_id}/assistants/{assistant_id}/files/{filename}/processed-content

Client Usage (useWorkbenchService)
const file = await getProcessedFileContentAsync(conversationId, assistantId, filename); switch (file.processing_status) { ... }

Minimal Example (assistant side) await put_state(conversation_id, "file_content_report.pdf", { "state": { "content": extracted_markdown, "content_type": "markdown", "metadata": { "mime_type": "application/pdf" } } })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant