mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-14 07:42:11 +02:00
feat: pluggable image-to-text service with OpenAI vision backend (#1038)
Adds a full-stack image description service: schema, base class,
OpenAI backend, gateway dispatch, client APIs (sync/async REST +
websocket), tg-describe-image CLI, IAM capability, and specs.
Closes #879
This commit is contained in:
parent
9136526863
commit
40f01c123b
42 changed files with 1845 additions and 14 deletions
|
|
@ -13,6 +13,7 @@ from unittest.mock import MagicMock
|
|||
|
||||
from trustgraph.schema import (
|
||||
TextCompletionRequest, TextCompletionResponse,
|
||||
ImageToTextRequest, ImageToTextResponse,
|
||||
DocumentRagQuery, DocumentRagResponse,
|
||||
AgentRequest, AgentResponse, AgentStep,
|
||||
Chunk, Triple, Triples, Term, Error,
|
||||
|
|
@ -29,7 +30,11 @@ def schema_registry():
|
|||
# Text Completion
|
||||
"TextCompletionRequest": TextCompletionRequest,
|
||||
"TextCompletionResponse": TextCompletionResponse,
|
||||
|
||||
|
||||
# Image to Text
|
||||
"ImageToTextRequest": ImageToTextRequest,
|
||||
"ImageToTextResponse": ImageToTextResponse,
|
||||
|
||||
# Document RAG
|
||||
"DocumentRagQuery": DocumentRagQuery,
|
||||
"DocumentRagResponse": DocumentRagResponse,
|
||||
|
|
@ -70,6 +75,20 @@ def sample_message_data():
|
|||
"out_token": 100,
|
||||
"model": "gpt-3.5-turbo"
|
||||
},
|
||||
"ImageToTextRequest": {
|
||||
# The image field carries base64 ASCII text end-to-end
|
||||
"image": "aW1hZ2UtYnl0ZXM=",
|
||||
"mime_type": "image/png",
|
||||
"prompt": "Describe this image",
|
||||
"system": "You are a helpful assistant."
|
||||
},
|
||||
"ImageToTextResponse": {
|
||||
"error": None,
|
||||
"description": "A single blue pixel on a white background.",
|
||||
"in_token": 245,
|
||||
"out_token": 32,
|
||||
"model": "gpt-5-mini"
|
||||
},
|
||||
"DocumentRagQuery": {
|
||||
"query": "What is artificial intelligence?",
|
||||
"collection": "test_collection",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue