Skip to content

Commit c952655

Browse files
committed
chore: update README usage
1 parent 13bd5bf commit c952655

File tree

2 files changed

+2
-42
lines changed

2 files changed

+2
-42
lines changed

README.md

+1-41
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The `PicaClientOptions` class allows you to configure the Pica client with the f
2222
| `connectors` | `List[str]` | Optional list of connector keys to give the LLM access to. If not provided, all available connectors will be initialized. |
2323

2424

25-
### Basic Usage
25+
### Quick Start
2626

2727
```python
2828
from langchain_openai import ChatOpenAI
@@ -88,46 +88,6 @@ result = agent.run("What actions are available in Gmail?")
8888
print(result)
8989
```
9090

91-
### Using Tools Directly
92-
93-
```python
94-
from pica_langchain import PicaClient, GetAvailableActionsTool, GetActionKnowledgeTool, ExecuteTool
95-
import json
96-
97-
# Initialize the Pica client
98-
pica_client = PicaClient(secret="your-pica-secret")
99-
100-
# Create individual tools
101-
get_actions_tool = GetAvailableActionsTool(client=pica_client)
102-
get_knowledge_tool = GetActionKnowledgeTool(client=pica_client)
103-
execute_tool = ExecuteTool(client=pica_client)
104-
105-
# Fetch available actions
106-
actions_result = get_actions_tool.run("gmail")
107-
print(actions_result)
108-
109-
# Parse actions result to extract an action ID
110-
actions_data = json.loads(actions_result)
111-
action_id = actions_data["actions"][0]["_id"]
112-
113-
# Retrieve action knowledge
114-
knowledge_result = get_knowledge_tool.run(platform="gmail", action_id=action_id)
115-
print(knowledge_result)
116-
117-
# Extract action path
118-
knowledge_data = json.loads(knowledge_result)
119-
action_path = knowledge_data["action"]["path"]
120-
121-
# Execute the action
122-
execute_result = execute_tool.run(
123-
platform="gmail",
124-
action_id=action_id,
125-
action_path=action_path,
126-
method="GET",
127-
connection_key="gmail-1"
128-
)
129-
print(execute_result)
130-
```
13191

13292
## Development
13393

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="pica-langchain",
5-
version="1.0.0",
5+
version="1.0.1",
66
packages=find_packages(),
77
install_requires=[
88
"langchain==0.3.20",

0 commit comments

Comments
 (0)