bs-agent 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,7 +36,11 @@ function App() {
|
|
|
36
36
|
|
|
37
37
|
// 2. Use the agent in your components
|
|
38
38
|
function ChatComponent() {
|
|
39
|
-
const agent = useAgentContext(
|
|
39
|
+
const agent = useAgentContext(
|
|
40
|
+
"your-agent-id",
|
|
41
|
+
"https://your-agent-url.com",
|
|
42
|
+
"your-access-key",
|
|
43
|
+
);
|
|
40
44
|
|
|
41
45
|
const handleSend = () => {
|
|
42
46
|
agent.handleSend("Hello, agent!");
|
|
@@ -91,6 +95,7 @@ function AgentChat() {
|
|
|
91
95
|
const agent = useAgentContext(
|
|
92
96
|
"my-agent-id", // Unique identifier for your agent
|
|
93
97
|
"https://agent-url.com", // Your agent's endpoint URL
|
|
98
|
+
"your-access-key", // Access key for authenticated requests (sent as Bearer token)
|
|
94
99
|
);
|
|
95
100
|
|
|
96
101
|
// Send a message
|
|
@@ -139,7 +144,7 @@ The `useAgentContext` hook returns an `AgentRunner` object with:
|
|
|
139
144
|
|
|
140
145
|
```tsx
|
|
141
146
|
function SessionList() {
|
|
142
|
-
const agent = useAgentContext("agent-id", "agent-url"
|
|
147
|
+
const agent = useAgentContext("agent-id", "agent-url");
|
|
143
148
|
|
|
144
149
|
return (
|
|
145
150
|
<div>
|