Skip to content

Commit cd4cf2c

Browse files
committed
Clarify plugin dependencies in OpenAPI documentation
- Add plugin comments to all UTCP imports - Show which imports come from core vs utcp-http plugin - Clarify YAML loader also handles JSON files
1 parent 7a7b63f commit cd4cf2c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/openapi-ingestion.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ UTCP automatically converts OpenAPI 2.0/3.0 specifications into UTCP tools, enab
77
Use the `OpenApiConverter` class for maximum control over the conversion process.
88

99
```python
10-
from utcp_http.openapi_converter import OpenApiConverter
10+
from utcp_http.openapi_converter import OpenApiConverter # utcp-http plugin
1111
import json
1212

1313
# From local JSON file
@@ -21,9 +21,10 @@ print(f"Generated {len(manual.tools)} tools")
2121
```
2222

2323
```python
24-
# From YAML file
24+
from utcp_http.openapi_converter import OpenApiConverter # utcp-http plugin
2525
import yaml
2626

27+
# From YAML file (can also be JSON)
2728
with open("api_spec.yaml", "r") as f:
2829
openapi_spec = yaml.safe_load(f)
2930

@@ -37,7 +38,7 @@ Fetch and convert OpenAPI specifications from remote URLs.
3738

3839
```python
3940
import aiohttp
40-
from utcp_http.openapi_converter import OpenApiConverter
41+
from utcp_http.openapi_converter import OpenApiConverter # utcp-http plugin
4142

4243
async def load_remote_spec(url):
4344
async with aiohttp.ClientSession() as session:
@@ -57,7 +58,7 @@ manual = await load_remote_spec("https://api.example.com/openapi.json")
5758
Include OpenAPI specs directly in your UTCP client configuration.
5859

5960
```python
60-
from utcp.utcp_client import UtcpClient
61+
from utcp.utcp_client import UtcpClient # core utcp package
6162

6263
config = {
6364
"manual_call_templates": [
@@ -98,8 +99,8 @@ Process multiple OpenAPI specifications programmatically.
9899

99100
```python
100101
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
103104

104105
async def process_multiple_specs(spec_urls):
105106
all_tools = []

0 commit comments

Comments
 (0)