Skip to content

Commit 1051b8c

Browse files
author
Erick Friis
authored
client example
1 parent 4fe4fef commit 1051b8c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ docker build . -t my-langserve-app
6161
```
6262

6363
If you tag your image with something other than `my-langserve-app`,
64-
note it for use in the next step.
64+
note it for use in the next step.
6565

6666
### Running the Image Locally
6767

@@ -77,3 +77,18 @@ We also expose port 8080 with the `-p 8080:8080` option.
7777
```shell
7878
docker run -e OPENAI_API_KEY=$OPENAI_API_KEY -p 8080:8080 my-langserve-app
7979
```
80+
# Connecting a Client
81+
82+
Example of invoking with `requests` in Python:
83+
84+
```python
85+
import requests
86+
87+
response = requests.post(
88+
"http://localhost:8000/search/invoke",
89+
json={'input': 'cats'}
90+
)
91+
response.json()
92+
```
93+
94+
You can also use [`RemoteRunnable` from LangServe](https://github.com/langchain-ai/langserve?tab=readme-ov-file#client) if calling your server from python or javascript.

0 commit comments

Comments
 (0)