File size: 808 Bytes
d6bb543
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Debug Context7 response to understand format"""

import asyncio
from ankigen_core.context7 import Context7Client


async def test_debug():
    client = Context7Client()

    # Get raw response
    result = await client.call_context7_tool(
        "resolve-library-id", {"libraryName": "pandas"}
    )

    if result and result.get("success") and result.get("text"):
        print("=== RAW RESPONSE ===")
        print(result["text"])
        print("=== END RESPONSE ===")

        # Also show line by line with indices
        lines = result["text"].split("\n")
        print("\n=== LINES WITH INDICES ===")
        for i, line in enumerate(lines):
            print(f"{i:3}: '{line}'")
    else:
        print("Failed to get response:", result)


if __name__ == "__main__":
    asyncio.run(test_debug())