mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-12 16:52:37 +02:00
Fixed document-rag workspace problem (#866)
- Fixed document-rag workspace problem - OpenAI text-completion processor now puts 'not-set' in the token if no token is set (new OpenAI library requires it to be set to something. - Update tests
This commit is contained in:
parent
03cc5ac80f
commit
d282d72db1
7 changed files with 22 additions and 19 deletions
|
|
@ -54,7 +54,7 @@ class TestDocumentRagIntegration:
|
|||
@pytest.fixture
|
||||
def mock_fetch_chunk(self):
|
||||
"""Mock fetch_chunk function that retrieves chunk content from librarian"""
|
||||
async def fetch(chunk_id, user):
|
||||
async def fetch(chunk_id):
|
||||
return CHUNK_CONTENT.get(chunk_id, f"Content for {chunk_id}")
|
||||
return fetch
|
||||
|
||||
|
|
|
|||
|
|
@ -297,10 +297,10 @@ class TestTextCompletionIntegration:
|
|||
@pytest.mark.asyncio
|
||||
async def test_text_completion_authentication_patterns(self):
|
||||
"""Test different authentication configurations"""
|
||||
# Test missing API key first (this should fail early)
|
||||
with pytest.raises(RuntimeError) as exc_info:
|
||||
Processor(id="test-no-key", api_key=None)
|
||||
assert "OpenAI API key not specified" in str(exc_info.value)
|
||||
# Test missing API key - now uses placeholder instead of raising
|
||||
# (newer openai package rejects empty string keys at validation)
|
||||
# Processor(id="test-no-key", api_key=None) would fail on
|
||||
# missing taskgroup, not on API key
|
||||
|
||||
# Test authentication pattern by examining the initialization logic
|
||||
# Since we can't fully instantiate due to taskgroup requirements,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue