MCPcopy Index your code
hub / github.com/simstudioai/sim / context_manager_example

Function context_manager_example

packages/python-sdk/examples/basic_usage.py:93–101  ·  view source on GitHub ↗

Example 4: Using context manager

()

Source from the content-addressed store, hash-verified

91
92
93def context_manager_example():
94 """Example 4: Using context manager"""
95 with SimStudioClient(api_key=os.getenv("SIM_API_KEY")) as client:
96 try:
97 result = client.execute_workflow("your-workflow-id")
98 print(f"Result: {result}")
99 except Exception as error:
100 print(f"Error: {error}")
101 # Session is automatically closed here
102
103
104def batch_execution_example():

Callers 1

basic_usage.pyFile · 0.85

Calls 2

SimStudioClientClass · 0.90
execute_workflowMethod · 0.80

Tested by

no test coverage detected