|
| 1 | +{ |
| 2 | + "description": "Offers an extensible mechanism for injecting custom logic at various stages of the request/response lifecycle, allowing for pre-processing, post-processing, and error handling customization.", |
| 3 | + "components": [ |
| 4 | + { |
| 5 | + "name": "Hook Contexts (DTOs)", |
| 6 | + "description": "A set of specialized Data Transfer Objects (DTOs) that encapsulate and pass relevant data and state through different stages of the API request/response lifecycle. These contexts provide the necessary information for hooks to operate on.", |
| 7 | + "referenced_source_code": [ |
| 8 | + { |
| 9 | + "qualified_name": "friendli_core._hooks.types.HookContext", |
| 10 | + "reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/_hooks/types.py", |
| 11 | + "reference_start_line": 11, |
| 12 | + "reference_end_line": 30 |
| 13 | + }, |
| 14 | + { |
| 15 | + "qualified_name": "friendli_core._hooks.types.BeforeRequestContext", |
| 16 | + "reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/_hooks/types.py", |
| 17 | + "reference_start_line": 33, |
| 18 | + "reference_end_line": 41 |
| 19 | + }, |
| 20 | + { |
| 21 | + "qualified_name": "friendli_core._hooks.types.AfterSuccessContext", |
| 22 | + "reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/_hooks/types.py", |
| 23 | + "reference_start_line": 44, |
| 24 | + "reference_end_line": 52 |
| 25 | + }, |
| 26 | + { |
| 27 | + "qualified_name": "friendli_core._hooks.types.AfterErrorContext", |
| 28 | + "reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/_hooks/types.py", |
| 29 | + "reference_start_line": 55, |
| 30 | + "reference_end_line": 63 |
| 31 | + } |
| 32 | + ], |
| 33 | + "can_expand": false |
| 34 | + }, |
| 35 | + { |
| 36 | + "name": "Hook Interface", |
| 37 | + "description": "Defines the abstract interface or base class that custom hooks must implement. It establishes the contract for various hook methods (e.g., `before_request`, `after_success`, `after_error`), ensuring a consistent extensibility point for SDK users.", |
| 38 | + "referenced_source_code": [ |
| 39 | + { |
| 40 | + "qualified_name": "friendli_core._hooks.types.Hooks", |
| 41 | + "reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/_hooks/types.py", |
| 42 | + "reference_start_line": 99, |
| 43 | + "reference_end_line": 114 |
| 44 | + } |
| 45 | + ], |
| 46 | + "can_expand": false |
| 47 | + }, |
| 48 | + { |
| 49 | + "name": "SDK Hooks Orchestrator", |
| 50 | + "description": "The central manager responsible for registering, storing, and orchestrating the execution of various custom hooks at the appropriate stages of the SDK's request/response lifecycle. It acts as a facade for the entire hooks mechanism.", |
| 51 | + "referenced_source_code": [ |
| 52 | + { |
| 53 | + "qualified_name": "friendli_core._hooks.sdkhooks.SDKHooks", |
| 54 | + "reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/_hooks/sdkhooks.py", |
| 55 | + "reference_start_line": 21, |
| 56 | + "reference_end_line": 78 |
| 57 | + } |
| 58 | + ], |
| 59 | + "can_expand": true |
| 60 | + } |
| 61 | + ], |
| 62 | + "components_relations": [ |
| 63 | + { |
| 64 | + "relation": "provides data to", |
| 65 | + "src_name": "Hook Contexts (DTOs)", |
| 66 | + "dst_name": "Hook Interface" |
| 67 | + }, |
| 68 | + { |
| 69 | + "relation": "interacts with", |
| 70 | + "src_name": "SDK Hooks Orchestrator", |
| 71 | + "dst_name": "Hook Contexts (DTOs)" |
| 72 | + }, |
| 73 | + { |
| 74 | + "relation": "orchestrates", |
| 75 | + "src_name": "SDK Hooks Orchestrator", |
| 76 | + "dst_name": "Hook Interface" |
| 77 | + }, |
| 78 | + { |
| 79 | + "relation": "receives", |
| 80 | + "src_name": "Hook Interface", |
| 81 | + "dst_name": "Hook Contexts (DTOs)" |
| 82 | + } |
| 83 | + ] |
| 84 | +} |
0 commit comments