Example 4: Using context manager
()
| 91 | |
| 92 | |
| 93 | def 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 | |
| 104 | def batch_execution_example(): |
no test coverage detected