@@ -7,7 +7,7 @@ UTCP automatically converts OpenAPI 2.0/3.0 specifications into UTCP tools, enab
7
7
Use the ` OpenApiConverter ` class for maximum control over the conversion process.
8
8
9
9
``` python
10
- from utcp_http.openapi_converter import OpenApiConverter
10
+ from utcp_http.openapi_converter import OpenApiConverter # utcp-http plugin
11
11
import json
12
12
13
13
# From local JSON file
@@ -21,9 +21,10 @@ print(f"Generated {len(manual.tools)} tools")
21
21
```
22
22
23
23
``` python
24
- # From YAML file
24
+ from utcp_http.openapi_converter import OpenApiConverter # utcp-http plugin
25
25
import yaml
26
26
27
+ # From YAML file (can also be JSON)
27
28
with open (" api_spec.yaml" , " r" ) as f:
28
29
openapi_spec = yaml.safe_load(f)
29
30
@@ -37,7 +38,7 @@ Fetch and convert OpenAPI specifications from remote URLs.
37
38
38
39
``` python
39
40
import aiohttp
40
- from utcp_http.openapi_converter import OpenApiConverter
41
+ from utcp_http.openapi_converter import OpenApiConverter # utcp-http plugin
41
42
42
43
async def load_remote_spec (url ):
43
44
async with aiohttp.ClientSession() as session:
@@ -57,7 +58,7 @@ manual = await load_remote_spec("https://api.example.com/openapi.json")
57
58
Include OpenAPI specs directly in your UTCP client configuration.
58
59
59
60
``` python
60
- from utcp.utcp_client import UtcpClient
61
+ from utcp.utcp_client import UtcpClient # core utcp package
61
62
62
63
config = {
63
64
" manual_call_templates" : [
@@ -98,8 +99,8 @@ Process multiple OpenAPI specifications programmatically.
98
99
99
100
``` python
100
101
import aiohttp
101
- from utcp_http.openapi_converter import OpenApiConverter
102
- from utcp.data.utcp_manual import UtcpManual
102
+ from utcp_http.openapi_converter import OpenApiConverter # utcp-http plugin
103
+ from utcp.data.utcp_manual import UtcpManual # core utcp package
103
104
104
105
async def process_multiple_specs (spec_urls ):
105
106
all_tools = []
0 commit comments