@@ -69,37 +69,9 @@ async def test_anti_hallucination():
6969 print (f"❌ Should have rejected: { field } " )
7070
7171 print ("\n " + "=" * 50 + "\n " )
72-
73- # Test 3: Get schema fields for specific sections
74- print ("3. Getting schema fields for specific sections..." )
75- sections = ["app" , "hawk" , "hawkAddOn" , "tags" ]
76-
77- for section in sections :
78- result = await server ._get_stackhawk_schema (section = section )
79- if "fields" in result :
80- print (f"✅ { section } section: { result ['total_fields' ]} fields" )
81- # Show first few fields
82- field_names = list (result ["fields" ].keys ())[:3 ]
83- print (f" Sample fields: { ', ' .join (field_names )} " )
84- else :
85- print (f"❌ Failed to get { section } fields: { result ['error' ]} " )
86-
87- print ("\n " + "=" * 50 + "\n " )
88-
89- # Test 4: Get all available fields
90- print ("4. Getting all available fields..." )
91- result = await server ._get_stackhawk_schema ()
92- if "all_fields" in result :
93- print (f"✅ Total fields available: { result ['total_fields' ]} " )
94- print (f" Available sections: { ', ' .join (result ['available_sections' ])} " )
95- print (f" Schema URL: { result ['schema_url' ]} " )
96- else :
97- print (f"❌ Failed to get all fields: { result .get ('error' , result .get ('message' , 'Unknown error' ))} " )
98-
99- print ("\n " + "=" * 50 + "\n " )
100-
101- # Test 6: Demonstrate how to prevent hallucination
102- print ("6. Anti-Hallucination Workflow Example:" )
72+
73+ # Test 3: Demonstrate how to prevent hallucination
74+ print ("3. Anti-Hallucination Workflow Example:" )
10375 print (" Step 1: Always validate fields before suggesting them" )
10476 print (" Step 2: Use get_stackhawk_schema to see what's actually available" )
10577 print (" Step 3: Use suggest_configuration for AI-powered recommendations" )
0 commit comments