Skip to content

Commit 9593a51

Browse files
committed
docs: update codeboarding architecture documentation
## πŸ“š Architecture Documentation Update This commit contains updated documentation files fetched from the CodeBoarding service and copied to the architecture documentation section. ### πŸ“Š Summary - Documentation files created/updated: 6 - JSON files created/updated: 7 - Documentation directory: .codeboarding/ - JSON directory: .codeboarding/ - Output format: .md - Repository analyzed: https://github.com/CodeBoarding/friendli-python - Destination: docs/architecture/ The generated .md files have been automatically copied to the architecture documentation section and referenced in on_boarding.md. πŸ€– This commit was automatically generated by the CodeBoarding documentation update workflow.
1 parent 27fb44c commit 9593a51

19 files changed

+1891
-0
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"description": "This analysis outlines the final component structure of the `friendli_core` SDK, detailing its five key components: Core Client, Service Modules, Data Models & Error Handling, Utility Functions, and Examples and Documentation. It describes each component's role, associated source files, and interactions within the SDK, providing a comprehensive overview of the system's architecture and interdependencies.",
3+
"components": [
4+
{
5+
"name": "Core Client",
6+
"description": "The central entry point for the SDK, responsible for managing authentication, session handling, and dispatching requests to the appropriate service modules. It provides the primary interface for users to interact with the Friendli AI platform.",
7+
"referenced_source_code": [
8+
{
9+
"qualified_name": "friendli_core.client",
10+
"reference_file": "friendli_core.client.py",
11+
"reference_start_line": 1,
12+
"reference_end_line": 1
13+
}
14+
],
15+
"can_expand": true
16+
},
17+
{
18+
"name": "Service Modules",
19+
"description": "Encapsulate specific API functionalities (e.g., chat, completions, image generation, audio processing). Each module provides high-level methods for its domain, abstracting the underlying RESTful API calls and handling domain-specific logic.",
20+
"referenced_source_code": [
21+
{
22+
"qualified_name": "friendli_core.chat",
23+
"reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/chat.py",
24+
"reference_start_line": null,
25+
"reference_end_line": null
26+
},
27+
{
28+
"qualified_name": "friendli_core.completions",
29+
"reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/completions.py",
30+
"reference_start_line": null,
31+
"reference_end_line": null
32+
},
33+
{
34+
"qualified_name": "friendli_core.image",
35+
"reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/image.py",
36+
"reference_start_line": null,
37+
"reference_end_line": null
38+
},
39+
{
40+
"qualified_name": "friendli_core.audio",
41+
"reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/audio.py",
42+
"reference_start_line": null,
43+
"reference_end_line": null
44+
}
45+
],
46+
"can_expand": true
47+
},
48+
{
49+
"name": "Data Models & Error Handling",
50+
"description": "Defines standardized data structures for all API requests and responses, ensuring consistent data representation across the SDK. This component also provides a comprehensive set of error types, facilitating robust and standardized error reporting from the Friendli AI platform.",
51+
"referenced_source_code": [
52+
{
53+
"qualified_name": "friendli_core.models",
54+
"reference_file": "friendli_core.models.py",
55+
"reference_start_line": 1,
56+
"reference_end_line": 1
57+
},
58+
{
59+
"qualified_name": "friendli_core.errors",
60+
"reference_file": "friendli_core.errors.py",
61+
"reference_start_line": 1,
62+
"reference_end_line": 1
63+
}
64+
],
65+
"can_expand": true
66+
},
67+
{
68+
"name": "Utility Functions",
69+
"description": "Provides common helper functions for SDK-wide tasks such as JSON serialization/deserialization, parameter validation, configuration loading, and other reusable logic that supports the core functionalities.",
70+
"referenced_source_code": [
71+
{
72+
"qualified_name": "friendli_core.utils",
73+
"reference_file": "friendli_core.utils.py",
74+
"reference_start_line": 1,
75+
"reference_end_line": 1
76+
}
77+
],
78+
"can_expand": false
79+
},
80+
{
81+
"name": "Examples and Documentation",
82+
"description": "Comprises practical code examples demonstrating how to effectively use the SDK's functionalities and comprehensive documentation (API references, guides) to assist developers in integrating and utilizing the Friendli AI platform.",
83+
"referenced_source_code": [
84+
{
85+
"qualified_name": "examples",
86+
"reference_file": "examples/",
87+
"reference_start_line": 1,
88+
"reference_end_line": 1
89+
},
90+
{
91+
"qualified_name": "docs",
92+
"reference_file": "docs/",
93+
"reference_start_line": 1,
94+
"reference_end_line": 1
95+
}
96+
],
97+
"can_expand": false
98+
}
99+
],
100+
"components_relations": [
101+
{
102+
"relation": "uses",
103+
"src_name": "Core Client",
104+
"dst_name": "Service Modules"
105+
},
106+
{
107+
"relation": "uses",
108+
"src_name": "Core Client",
109+
"dst_name": "Data Models & Error Handling"
110+
},
111+
{
112+
"relation": "uses",
113+
"src_name": "Core Client",
114+
"dst_name": "Utility Functions"
115+
},
116+
{
117+
"relation": "utilizes",
118+
"src_name": "Service Modules",
119+
"dst_name": "Data Models & Error Handling"
120+
},
121+
{
122+
"relation": "uses",
123+
"src_name": "Service Modules",
124+
"dst_name": "Utility Functions"
125+
},
126+
{
127+
"relation": "showcases usage of",
128+
"src_name": "Examples and Documentation",
129+
"dst_name": "Core Client"
130+
},
131+
{
132+
"relation": "showcases usage of",
133+
"src_name": "Examples and Documentation",
134+
"dst_name": "Service Modules"
135+
},
136+
{
137+
"relation": "relies on",
138+
"src_name": "Examples and Documentation",
139+
"dst_name": "Data Models & Error Handling"
140+
}
141+
]
142+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
```mermaid
2+
graph LR
3+
Core_Client["Core Client"]
4+
Service_Modules["Service Modules"]
5+
Data_Models_Error_Handling["Data Models & Error Handling"]
6+
Utility_Functions["Utility Functions"]
7+
Examples_and_Documentation["Examples and Documentation"]
8+
Core_Client -- "uses" --> Service_Modules
9+
Core_Client -- "uses" --> Data_Models_Error_Handling
10+
Core_Client -- "uses" --> Utility_Functions
11+
Service_Modules -- "utilizes" --> Data_Models_Error_Handling
12+
Service_Modules -- "uses" --> Utility_Functions
13+
Examples_and_Documentation -- "showcases usage of" --> Core_Client
14+
Examples_and_Documentation -- "showcases usage of" --> Service_Modules
15+
Examples_and_Documentation -- "relies on" --> Data_Models_Error_Handling
16+
click Service_Modules href "https://github.com/CodeBoarding/friendli-python/blob/main/.codeboarding/Service_Modules.md" "Details"
17+
click Data_Models_Error_Handling href "https://github.com/CodeBoarding/friendli-python/blob/main/.codeboarding/Data_Models_Error_Handling.md" "Details"
18+
```
19+
20+
[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org)
21+
22+
## Details
23+
24+
This analysis outlines the final component structure of the `friendli_core` SDK, detailing its five key components: Core Client, Service Modules, Data Models & Error Handling, Utility Functions, and Examples and Documentation. It describes each component's role, associated source files, and interactions within the SDK, providing a comprehensive overview of the system's architecture and interdependencies.
25+
26+
### Core Client
27+
The central entry point for the SDK, responsible for managing authentication, session handling, and dispatching requests to the appropriate service modules. It provides the primary interface for users to interact with the Friendli AI platform.
28+
29+
30+
**Related Classes/Methods**:
31+
32+
- `friendli_core.client` (1:1)
33+
34+
35+
### Service Modules [[Expand]](./Service_Modules.md)
36+
Encapsulate specific API functionalities (e.g., chat, completions, image generation, audio processing). Each module provides high-level methods for its domain, abstracting the underlying RESTful API calls and handling domain-specific logic.
37+
38+
39+
**Related Classes/Methods**:
40+
41+
- `friendli_core.chat`
42+
- `friendli_core.completions`
43+
- `friendli_core.image`
44+
- `friendli_core.audio`
45+
46+
47+
### Data Models & Error Handling [[Expand]](./Data_Models_Error_Handling.md)
48+
Defines standardized data structures for all API requests and responses, ensuring consistent data representation across the SDK. This component also provides a comprehensive set of error types, facilitating robust and standardized error reporting from the Friendli AI platform.
49+
50+
51+
**Related Classes/Methods**:
52+
53+
- `friendli_core.models` (1:1)
54+
- `friendli_core.errors` (1:1)
55+
56+
57+
### Utility Functions
58+
Provides common helper functions for SDK-wide tasks such as JSON serialization/deserialization, parameter validation, configuration loading, and other reusable logic that supports the core functionalities.
59+
60+
61+
**Related Classes/Methods**:
62+
63+
- `friendli_core.utils` (1:1)
64+
65+
66+
### Examples and Documentation
67+
Comprises practical code examples demonstrating how to effectively use the SDK's functionalities and comprehensive documentation (API references, guides) to assist developers in integrating and utilizing the Friendli AI platform.
68+
69+
70+
**Related Classes/Methods**:
71+
72+
- `examples` (1:1)
73+
- `docs` (1:1)
74+
75+
76+
77+
78+
### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq)
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
{
2+
"description": "Final Component Overview for the `Friendli Client (Public API)` subsystem, structured according to Client-side SDK patterns.",
3+
"components": [
4+
{
5+
"name": "Core Client (Public API)",
6+
"description": "The primary entry point for end-users, offering a high-level, consistent interface for interacting with the Friendli AI platform, supporting both synchronous and asynchronous operations. It acts as the orchestrator, delegating requests to specific service modules.",
7+
"referenced_source_code": [
8+
{
9+
"qualified_name": "friendli_core.sdk",
10+
"reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/sdk.py",
11+
"reference_start_line": null,
12+
"reference_end_line": null
13+
}
14+
],
15+
"can_expand": true
16+
},
17+
{
18+
"name": "Service Modules",
19+
"description": "Encapsulate the logic for interacting with specific API endpoints (e.g., chat, completions, images, audio). Each module handles the construction of requests, serialization of data models, and deserialization of responses for its domain.",
20+
"referenced_source_code": [
21+
{
22+
"qualified_name": "friendli_core.chat",
23+
"reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/chat.py",
24+
"reference_start_line": null,
25+
"reference_end_line": null
26+
},
27+
{
28+
"qualified_name": "friendli_core.completions",
29+
"reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/completions.py",
30+
"reference_start_line": null,
31+
"reference_end_line": null
32+
},
33+
{
34+
"qualified_name": "friendli_core.images",
35+
"reference_file": "friendli_core.images",
36+
"reference_start_line": 1,
37+
"reference_end_line": 1
38+
},
39+
{
40+
"qualified_name": "friendli_core.audio",
41+
"reference_file": "/mnt/e/StartUp/friendli-python/src/friendli_core/audio.py",
42+
"reference_start_line": null,
43+
"reference_end_line": null
44+
}
45+
],
46+
"can_expand": true
47+
},
48+
{
49+
"name": "Data Models",
50+
"description": "Define the structure of data exchanged with the Friendli AI platform, including request bodies, response objects, and various parameters. Ensures type safety and consistency across all API interactions within the SDK.",
51+
"referenced_source_code": [
52+
{
53+
"qualified_name": "friendli_core.models",
54+
"reference_file": "friendli_core.models",
55+
"reference_start_line": 1,
56+
"reference_end_line": 1
57+
}
58+
],
59+
"can_expand": false
60+
},
61+
{
62+
"name": "HTTP Client/Transport Layer",
63+
"description": "Handles the low-level HTTP communication with the Friendli AI platform. This includes managing connections, sending requests, receiving responses, and abstracting away network-level concerns like retries and timeouts.",
64+
"referenced_source_code": [
65+
{
66+
"qualified_name": "friendli_core.http_client",
67+
"reference_file": "friendli_core.http_client",
68+
"reference_start_line": 1,
69+
"reference_end_line": 1
70+
}
71+
],
72+
"can_expand": true
73+
},
74+
{
75+
"name": "Error Handling",
76+
"description": "Manages and standardizes error responses from both the API and the network layer. It provides custom exception classes and mechanisms for users to gracefully handle API-related issues and network errors, ensuring a consistent error reporting experience.",
77+
"referenced_source_code": [
78+
{
79+
"qualified_name": "friendli_core.errors",
80+
"reference_file": "friendli_core.errors",
81+
"reference_start_line": 1,
82+
"reference_end_line": 1
83+
}
84+
],
85+
"can_expand": true
86+
},
87+
{
88+
"name": "Configuration Management",
89+
"description": "Centralizes and manages SDK-wide configuration settings, such as API keys, base URLs, default timeouts, and retry policies. It provides a consistent and accessible way to configure the SDK's behavior.",
90+
"referenced_source_code": [
91+
{
92+
"qualified_name": "friendli_core.config",
93+
"reference_file": "friendli_core.config",
94+
"reference_start_line": 1,
95+
"reference_end_line": 1
96+
}
97+
],
98+
"can_expand": false
99+
},
100+
{
101+
"name": "Utility Functions",
102+
"description": "Provides common helper functions and reusable functionalities that support various parts of the SDK, such as authentication token management, data validation, or specific data transformations that are not tied to a particular API domain.",
103+
"referenced_source_code": [
104+
{
105+
"qualified_name": "friendli_core.utils",
106+
"reference_file": "friendli_core.utils",
107+
"reference_start_line": 1,
108+
"reference_end_line": 1
109+
}
110+
],
111+
"can_expand": true
112+
}
113+
],
114+
"components_relations": [
115+
{
116+
"relation": "uses",
117+
"src_name": "Core Client (Public API)",
118+
"dst_name": "Service Modules"
119+
},
120+
{
121+
"relation": "uses",
122+
"src_name": "Core Client (Public API)",
123+
"dst_name": "Configuration Management"
124+
},
125+
{
126+
"relation": "uses",
127+
"src_name": "Core Client (Public API)",
128+
"dst_name": "Data Models"
129+
},
130+
{
131+
"relation": "uses",
132+
"src_name": "Core Client (Public API)",
133+
"dst_name": "Utility Functions"
134+
},
135+
{
136+
"relation": "uses",
137+
"src_name": "Service Modules",
138+
"dst_name": "HTTP Client/Transport Layer"
139+
},
140+
{
141+
"relation": "uses",
142+
"src_name": "Service Modules",
143+
"dst_name": "Data Models"
144+
},
145+
{
146+
"relation": "uses",
147+
"src_name": "Service Modules",
148+
"dst_name": "Error Handling"
149+
},
150+
{
151+
"relation": "uses",
152+
"src_name": "Service Modules",
153+
"dst_name": "Utility Functions"
154+
},
155+
{
156+
"relation": "uses",
157+
"src_name": "HTTP Client/Transport Layer",
158+
"dst_name": "Configuration Management"
159+
},
160+
{
161+
"relation": "uses",
162+
"src_name": "HTTP Client/Transport Layer",
163+
"dst_name": "Error Handling"
164+
}
165+
]
166+
}

0 commit comments

Comments
Β (0)