Skip to content

Commit 246c289

Browse files
committed
Fix failing
1 parent 01223d4 commit 246c289

File tree

2 files changed

+69
-3
lines changed

2 files changed

+69
-3
lines changed

.github/workflows/continuous-docs-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
echo "🧪 Running tests..."
223223
source .venv/bin/activate
224224
225-
pytest -m pyv4 -v --tb=short --durations=10
225+
pytest -m pyv4 -v --tb=short --durations=10 tests/test_quickstart.py
226226
227227
echo "✅ Tests completed"
228228

_includes/code/python/local.quickstart.query.rag.py

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,81 @@
55

66
questions = client.collections.get("Question")
77

8+
print("=== DEBUG: Getting collection configuration ===")
9+
config = questions.config.get()
10+
print(f"DEBUG: Collection config type: {type(config)}")
11+
print(f"DEBUG: Collection config: {config}")
12+
13+
# Print vector configuration
14+
if hasattr(config, "vector_config"):
15+
print(f"DEBUG: Vector config: {config.vector_config}")
16+
if hasattr(config.vector_config, "vectorizer"):
17+
print(f"DEBUG: Vectorizer: {config.vector_config.vectorizer}")
18+
if hasattr(config.vector_config.vectorizer, "config"):
19+
print(f"DEBUG: Vectorizer config: {config.vector_config.vectorizer.config}")
20+
21+
# Print generative configuration
22+
if hasattr(config, "generative_config"):
23+
print(f"DEBUG: Generative config: {config.generative_config}")
24+
if hasattr(config.generative_config, "generative"):
25+
print(f"DEBUG: Generative: {config.generative_config.generative}")
26+
if hasattr(config.generative_config.generative, "config"):
27+
print(
28+
f"DEBUG: Generative config: {config.generative_config.generative.config}"
29+
)
30+
31+
print("=== DEBUG: Starting RAG query ===")
32+
833
# highlight-start
934
response = questions.generate.near_text(
1035
query="biology",
1136
limit=2,
12-
grouped_task="Write a tweet with emojis about these facts."
37+
grouped_task="Write a tweet with emojis about these facts.",
1338
)
1439
# highlight-end
1540

16-
print(response.generative.text) # Inspect the generated text
41+
print(f"DEBUG: Response type: {type(response)}")
42+
print(f"DEBUG: Response object: {response}")
43+
print(
44+
f"DEBUG: Response attributes: {[attr for attr in dir(response) if not attr.startswith('_')]}"
45+
)
46+
47+
# Check if response has generative attribute
48+
if hasattr(response, "generative"):
49+
print(f"DEBUG: response.generative type: {type(response.generative)}")
50+
print(f"DEBUG: response.generative value: {response.generative}")
51+
52+
if response.generative is not None:
53+
print(
54+
f"DEBUG: generative attributes: {[attr for attr in dir(response.generative) if not attr.startswith('_')]}"
55+
)
56+
57+
if hasattr(response.generative, "text"):
58+
print(f"DEBUG: Generated text exists: {response.generative.text}")
59+
else:
60+
print("DEBUG: ERROR - response.generative has no 'text' attribute")
61+
else:
62+
print("DEBUG: ERROR - response.generative is None")
63+
else:
64+
print("DEBUG: ERROR - response has no 'generative' attribute")
65+
66+
# Check if there are search results
67+
if hasattr(response, "objects"):
68+
print(f"DEBUG: Number of objects found: {len(response.objects)}")
69+
for i, obj in enumerate(response.objects):
70+
print(f"DEBUG: Object {i+1}: {obj.properties}")
71+
else:
72+
print("DEBUG: No objects found in response")
73+
74+
# Only print the text if it exists
75+
if (
76+
hasattr(response, "generative")
77+
and response.generative is not None
78+
and hasattr(response.generative, "text")
79+
):
80+
print(response.generative.text) # Inspect the generated text
81+
else:
82+
print("ERROR: Cannot access response.generative.text - it's None or doesn't exist")
1783

1884
client.close() # Free up resources
1985
# END RAG

0 commit comments

Comments
 (0)