Update veryfinal.py
Browse files- veryfinal.py +13 -3
veryfinal.py
CHANGED
@@ -305,10 +305,20 @@ class HybridLangGraphAgnoSystem:
|
|
305 |
except Exception as e:
|
306 |
return {"answer":f"Error: {e}","performance_metrics":{},"provider_used":"Error"}
|
307 |
|
308 |
-
def build_graph(provider: str="hybrid"):
|
309 |
-
|
|
|
|
|
|
|
|
|
|
|
310 |
return HybridLangGraphAgnoSystem().graph
|
311 |
-
|
|
|
|
|
|
|
|
|
|
|
312 |
|
313 |
# Test
|
314 |
if __name__=="__main__":
|
|
|
305 |
except Exception as e:
|
306 |
return {"answer":f"Error: {e}","performance_metrics":{},"provider_used":"Error"}
|
307 |
|
308 |
+
def build_graph(provider: str = "hybrid"):
|
309 |
+
"""
|
310 |
+
Build and return the StateGraph for the requested provider.
|
311 |
+
- "hybrid" returns the HybridLangGraphAgnoSystem graph.
|
312 |
+
- "groq", "google", "nvidia" all fall back to the hybrid graph.
|
313 |
+
"""
|
314 |
+
if provider == "hybrid":
|
315 |
return HybridLangGraphAgnoSystem().graph
|
316 |
+
elif provider in ("groq", "google", "nvidia"):
|
317 |
+
# Simply reuse the hybrid graph under these names
|
318 |
+
return HybridLangGraphAgnoSystem().graph
|
319 |
+
else:
|
320 |
+
raise ValueError(f"Only 'hybrid', 'groq', 'google', or 'nvidia' supported (got '{provider}')")
|
321 |
+
|
322 |
|
323 |
# Test
|
324 |
if __name__=="__main__":
|