You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# set params to empty if you want to process all pages
98
+
#params = {}
99
+
headers = {}
100
+
101
+
# copy this URL from the Application information in the stack for this API
102
+
url ="<api_endpoint_url>"
103
+
response = requests.post(
104
+
url=url,
105
+
data=file_content,
106
+
auth=auth,
107
+
params=params,
108
+
headers=headers
109
+
)
110
+
111
+
```
112
+
113
+
#### MCP example using Accelerated Data Science
114
+
115
+
You can use ADS package to connect with the MCP endpoints. Follow instructions [here](https://accelerated-data-science.readthedocs.io/en/latest/user_guide/cli/quickstart.html) on how to install ADS.
116
+
117
+
118
+
```python
119
+
import asyncio
120
+
121
+
import ads
122
+
from ads.aqua import HttpxOCIAuth
123
+
from fastmcp import Client
124
+
from fastmcp.client.transports import StreamableHttpTransport
125
+
126
+
# change profile accordingly
127
+
ads.set_auth("security_token", profile="DEFAULT")
128
+
129
+
# copy this URL from the Application information in the stack for this endpoint
text ="The twilight shimmered over the quiet town as the last train whistled in the distance. A lone cat perched atop a fence, its eyes reflecting the amber glow of a streetlamp. Inside a nearby café, the faint hum of jazz blended with the gentle clinking of cups. Somewhere, a typewriter clicked — each keystroke a heartbeat in the rhythm of a sleepless night. Outside, rain began to fall, soft and steady, painting the cobblestones with fleeting constellations of light."
95
+
96
+
payload = {
97
+
"text": text,
98
+
"language": "French",
99
+
"stream": True
100
+
}
101
+
102
+
with requests.post(url, json=payload, auth=auth, stream=True) as r:
103
+
print("Status:", r.status_code)
104
+
r.raise_for_status()
105
+
106
+
for line in r.iter_lines(decode_unicode=True):
107
+
if line:
108
+
print(line)
109
+
```
110
+
111
+
#### MCP example using Accelerated Data Science
112
+
113
+
You can use ADS package to connect with the MCP endpoints. Follow instructions [here](https://accelerated-data-science.readthedocs.io/en/latest/user_guide/cli/quickstart.html) on how to install ADS.
114
+
115
+
116
+
```python
117
+
import asyncio
118
+
119
+
import ads
120
+
from ads.aqua import HttpxOCIAuth
121
+
from fastmcp import Client
122
+
from fastmcp.client.transports import StreamableHttpTransport
123
+
124
+
125
+
ads.set_auth("security_token", profile="DEV")
126
+
127
+
# copy this URL from the Application information in the stack for this endpoint
0 commit comments