Feature/streaming llm phase 1 (#566)

* Tidy up duplicate tech specs in doc directory

* Streaming LLM text-completion service tech spec.

* text-completion and prompt interfaces

* streaming change applied to all LLMs, so far tested with VertexAI

* Skip Pinecone unit tests, upstream module issue is affecting things, tests are passing again

* Added agent streaming, not working and has broken tests
This commit is contained in:
cybermaggedon 2025-11-26 09:59:10 +00:00 committed by GitHub
parent 943a9d83b0
commit 310a2deb06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 2684 additions and 937 deletions

View file

@ -282,10 +282,11 @@ class TestTextCompletionIntegration:
# Assert
# Verify OpenAI API call parameters
call_args = mock_openai_client.chat.completions.create.call_args
assert call_args.kwargs['response_format'] == {"type": "text"}
assert call_args.kwargs['top_p'] == 1
assert call_args.kwargs['frequency_penalty'] == 0
assert call_args.kwargs['presence_penalty'] == 0
# Note: response_format, top_p, frequency_penalty, and presence_penalty
# were removed in #561 as unnecessary parameters
assert 'model' in call_args.kwargs
assert 'temperature' in call_args.kwargs
assert 'max_tokens' in call_args.kwargs
# Verify result structure
assert hasattr(result, 'text')
@ -362,9 +363,8 @@ class TestTextCompletionIntegration:
assert call_args.kwargs['model'] == "gpt-4"
assert call_args.kwargs['temperature'] == 0.8
assert call_args.kwargs['max_tokens'] == 2048
assert call_args.kwargs['top_p'] == 1
assert call_args.kwargs['frequency_penalty'] == 0
assert call_args.kwargs['presence_penalty'] == 0
# Note: top_p, frequency_penalty, and presence_penalty
# were removed in #561 as unnecessary parameters
@pytest.mark.asyncio
@pytest.mark.slow

View file

@ -5,6 +5,9 @@ Tests for Pinecone document embeddings query service
import pytest
from unittest.mock import MagicMock, patch
# Skip all tests in this module due to missing Pinecone dependency
pytest.skip("Pinecone library missing protoc_gen_openapiv2 dependency", allow_module_level=True)
from trustgraph.query.doc_embeddings.pinecone.service import Processor

View file

@ -5,6 +5,9 @@ Tests for Pinecone graph embeddings query service
import pytest
from unittest.mock import MagicMock, patch
# Skip all tests in this module due to missing Pinecone dependency
pytest.skip("Pinecone library missing protoc_gen_openapiv2 dependency", allow_module_level=True)
from trustgraph.query.graph_embeddings.pinecone.service import Processor
from trustgraph.schema import Value

View file

@ -6,6 +6,9 @@ import pytest
from unittest.mock import MagicMock, patch
import uuid
# Skip all tests in this module due to missing Pinecone dependency
pytest.skip("Pinecone library missing protoc_gen_openapiv2 dependency", allow_module_level=True)
from trustgraph.storage.doc_embeddings.pinecone.write import Processor
from trustgraph.schema import ChunkEmbeddings

View file

@ -6,6 +6,9 @@ import pytest
from unittest.mock import MagicMock, patch
import uuid
# Skip all tests in this module due to missing Pinecone dependency
pytest.skip("Pinecone library missing protoc_gen_openapiv2 dependency", allow_module_level=True)
from trustgraph.storage.graph_embeddings.pinecone.write import Processor
from trustgraph.schema import EntityEmbeddings, Value