Skip to content
Prev Previous commit
Next Next commit
Update one-line deploy playground URL
  • Loading branch information
svarlamov committed Jun 8, 2023
commit 31855af41f3bb6804301757ab5f48c7ed373a6db
16 changes: 14 additions & 2 deletions examples/be-example-express-sqlite/src/agent-playground.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
import {playground} from "@convostack/playground";
import {playground, PlaygroundAgentProxy} from "@convostack/playground";
import {AgentEcho} from "@convostack/agent-echo";
import {IAgentCallbacks, IAgentContext, IAgentResponse} from "@convostack/agent";

playground(new AgentEcho())
const agent = new AgentEcho();
// One-liner for hosted version
playground(agent)

// playground({
// reply(context: IAgentContext, callbacks?: IAgentCallbacks): Promise<IAgentResponse> {
// // Your logic
// }
// })
// const pap = new PlaygroundAgentProxy(agent);
// pap.setProxyUrl('ws://localhost:8088/agent')
// pap.connect()
2 changes: 1 addition & 1 deletion packages/convostack-playground/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class PlaygroundAgentProxy {
agentId = dataStr.replace('AGENT_ID:', '')
this.operation.reset()
// TODO Improve formatting
console.log(`[ConvoStack] 🚀 Interact with your Agent live now: https://playground.convostack.ai/dev?agent=${encodeURIComponent(agentId)}`);
console.log(`[ConvoStack] 🚀 Interact with your Agent live now: https://playground.convostack.ai/dev?agent=pxy::${encodeURIComponent(agentId)}`);
} else {
const message: IProxyMessage = JSON.parse(dataStr);
// Delegate request handling to the agent
Expand Down