|
62 | 62 | from langchain_oci.chat_models import ChatOCIGenAI |
63 | 63 |
|
64 | 64 | def default_compartment(): |
65 | | - return "ocid1.tenancy.oc1..aaaaaaaa7ayxuw32vjb64hbxtouarftwtwb2uat5x5mf4hu7cvzaesfrebrq" |
| 65 | + return "<compartment_ocid>" # for convenience |
66 | 66 |
|
67 | 67 | def get_weather(city: str) -> str: |
68 | 68 | """Get the current weather for a given city name.""" |
@@ -162,9 +162,7 @@ def test_tool_calling_no_infinite_loop(model_id: str, weather_tool: StructuredTo |
162 | 162 | SystemMessage(content=system_msg), |
163 | 163 | HumanMessage(content="What's the weather in Chicago?"), |
164 | 164 | ] |
165 | | - }, |
166 | | - config={"recursion_limit": 25}, # Allow enough recursion for multi-step |
167 | | - |
| 165 | + } |
168 | 166 | ) |
169 | 167 |
|
170 | 168 | messages = result["messages"] |
@@ -217,7 +215,7 @@ def test_tool_calling_no_infinite_loop(model_id: str, weather_tool: StructuredTo |
217 | 215 | @pytest.mark.requires("oci") |
218 | 216 | def test_meta_llama_tool_calling(weather_tool: StructuredTool): |
219 | 217 | """Specific test for Meta Llama models to ensure fix works.""" |
220 | | - model_id = "meta.llama-4-scout-17b-16e-instruct" # gets recursion error |
| 218 | + model_id = "meta.llama-4-scout-17b-16e-instruct" |
221 | 219 |
|
222 | 220 | agent = create_agent(model_id, weather_tool) |
223 | 221 |
|
@@ -524,6 +522,6 @@ def should_continue(state: MessagesState): |
524 | 522 | # Set your desired defaults here or fetch them by any required means. |
525 | 523 | # You may also load from a local file, IDE Run Config, etc. |
526 | 524 | os.environ.setdefault("OCI_REGION", "us-chicago-1") # Edit as appropriate |
527 | | - os.environ.setdefault("OCI_COMP", "ocid1.tenancy.oc1..aaaaaaaa7ayxuw32vjb64hbxtouarftwtwb2uat5x5mf4hu7cvzaesfrebrq") # Edit as appropriate |
| 525 | + os.environ.setdefault("OCI_COMP", "<compartment_ocid>") # Edit as appropriate |
528 | 526 | # This runs all tests in this file if you run it as a script in your IDE. |
529 | 527 | pytest.main([__file__]) |
0 commit comments