From fef4f8015d0ac3fec01c862ca3a2aa7b9be220c9 Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Fri, 25 Jul 2025 17:43:06 +0800 Subject: [PATCH] add curl code --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 88cd6400..64f67e38 100644 --- a/README.md +++ b/README.md @@ -513,6 +513,9 @@ Here's how to load and use the Appworld experience library: #### Step 1: Load Pre-built Experiences +
+Python + ```python import requests @@ -525,11 +528,29 @@ response = requests.post(url="http://0.0.0.0:8001/vector_store", json={ print(f"loading result result={response.json()}") ``` +
+ +
+curl + +```bash +curl -X POST "http://0.0.0.0:8001/vector_store" \ + -H "Content-Type: application/json" \ + -d '{ + "workspace_id": "appworld_v1", + "action": "load", + "path": "./experience_library/" + }' +``` +
#### Step 2: Retrieve Relevant Experiences Now you can query the loaded experiences to get contextual guidance for your tasks: +
+Python + ```python import requests @@ -543,6 +564,21 @@ response = requests.post(url="http://0.0.0.0:8001/retriever", json={ experience_merged = response.json()["experience_merged"] print(f"Retrieved experiences: {experience_merged}") ``` +
+ +
+curl + +```bash +curl -X POST "http://0.0.0.0:8001/retriever" \ + -H "Content-Type: application/json" \ + -d '{ + "workspace_id": "appworld_v1", + "query": "How to navigate to settings and update user profile information?", + "top_k": 1 + }' +``` +
---