Skip to content

Commit 12c6882

Browse files
committed
docs: removing insecure password protection for now released content
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
1 parent 72ba5e8 commit 12c6882

16 files changed

Lines changed: 876 additions & 349 deletions

docs/content/docs/(root)/guides/backend-actions/langgraph-platform-endpoint.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import { FaCloud, FaServer } from "react-icons/fa";
3535
description="I'm already using or want to use Copilot Cloud."
3636
icon={<FaCloud />}
3737
>
38-
<InsecurePasswordProtected>
3938
If you followed the [Copilot Cloud Quickstart](/docs/quickstart) and opted to use CopilotCloud,
4039
you only need to add your LangGraph Platform deployment URL and LangSmith API key to your CopilotCloud.
4140

@@ -46,7 +45,6 @@ import { FaCloud, FaServer } from "react-icons/fa";
4645
</Accordion>
4746
</Accordions>
4847
<CopilotCloudConfigureRemoteEndpointLangGraphSnippet components={props.components} />
49-
</InsecurePasswordProtected>
5048
</TailoredContentOption>
5149
<TailoredContentOption
5250
title="Self-Hosted"

docs/content/docs/(root)/guides/backend-actions/remote-backend-endpoint.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ Now that you've set up your FastAPI server with the backend actions, integrate i
196196
description="I want to use Copilot Cloud to connect to my remote endpoint."
197197
icon={<FaCloud />}
198198
>
199-
<InsecurePasswordProtected>
200199
<CopilotCloudConfigureRemoteEndpointSnippet components={props.components} />
201-
</InsecurePasswordProtected>
202200
</TailoredContentOption>
203201
<TailoredContentOption
204202
title="Self-Hosted Copilot Runtime"

docs/content/docs/(root)/quickstart.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { FaCloud, FaServer } from "react-icons/fa";
1818
description="Use our hosted backend endpoint to get started quickly (OpenAI only)."
1919
icon={<FaCloud />}
2020
>
21-
<InsecurePasswordProtected>
2221

2322
## Install Dependencies
2423

@@ -29,7 +28,6 @@ npm install @copilotkit/react-ui @copilotkit/react-core
2928
```
3029

3130
In order to use CopilotKit, we'll need to configure the `CopilotKit` provider.
32-
</InsecurePasswordProtected>
3331

3432
## Setup CopilotKit
3533

docs/content/docs/(root)/tutorials/ai-powered-textarea/step-2-setup-copilotkit.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ npm install @copilotkit/react-core @copilotkit/react-textarea
2727
description="Use our hosted backend endpoint to get started quickly (OpenAI only)."
2828
icon={<FaCloud />}
2929
>
30-
<InsecurePasswordProtected>
3130
In order to use CopilotKit, we'll need to configure the CopilotKit provider.
3231

3332
<CopilotCloudConfigureCopilotKitProvider components={props.components} />
34-
</InsecurePasswordProtected>
3533
</TailoredContentOption>
3634
<TailoredContentOption
3735
title="Self-hosting"

docs/content/docs/(root)/tutorials/ai-todo-app/step-2-setup-copilotkit.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ npm install @copilotkit/react-core @copilotkit/react-ui
2828
description="Use our hosted backend endpoint to get started quickly (OpenAI only)."
2929
icon={<FaCloud />}
3030
>
31-
<InsecurePasswordProtected>
3231
In order to use CopilotKit, we'll need to configure the `CopilotKit` provider.
3332

3433
<CopilotCloudConfigureCopilotKitProvider components={props.components} />
35-
</InsecurePasswordProtected>
3634
</TailoredContentOption>
3735
<TailoredContentOption
3836
title="Self-hosting"

docs/content/docs/coagents/advanced/copilotkit-state.mdx

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ To access the frontend actions provided by CopilotKit, you can inherit from Copi
3131
```
3232
</Tab>
3333
<Tab value="TypeScript">
34-
<InsecurePasswordProtected>
35-
```typescript
36-
import { Annotation } from "@langchain/langgraph";
37-
import { CopilotKitStateAnnotation } from "@copilotkit/sdk-js/langchain";
38-
39-
export const YourAgentStateAnnotation = Annotation.Root({
40-
yourAdditionalProperty: Annotation<string>,
41-
...CopilotKitStateAnnotation.spec,
42-
});
43-
export type YourAgentState = typeof YourAgentStateAnnotation.State;
44-
```
45-
</InsecurePasswordProtected>
34+
```typescript
35+
import { Annotation } from "@langchain/langgraph";
36+
import { CopilotKitStateAnnotation } from "@copilotkit/sdk-js/langchain";
37+
38+
export const YourAgentStateAnnotation = Annotation.Root({
39+
yourAdditionalProperty: Annotation<string>,
40+
...CopilotKitStateAnnotation.spec,
41+
});
42+
export type YourAgentState = typeof YourAgentStateAnnotation.State;
43+
```
4644
</Tab>
4745
</Tabs>
4846

@@ -67,18 +65,16 @@ Here's how you can call a frontend action from your agent:
6765
```
6866
</Tab>
6967
<Tab value="TypeScript">
70-
<InsecurePasswordProtected>
71-
```typescript
72-
async function agentNode(state: YourAgentState, config: RunnableConfig): Promise<YourAgentState> {
73-
// Access the actions from the copilotkit property
74-
75-
const actions = state.copilotkit.actions;
76-
const model = ChatOpenAI({ model: 'gpt-4o' }).bindTools(actions);
77-
78-
// ...
79-
}
80-
```
81-
</InsecurePasswordProtected>
68+
```typescript
69+
async function agentNode(state: YourAgentState, config: RunnableConfig): Promise<YourAgentState> {
70+
// Access the actions from the copilotkit property
71+
72+
const actions = state.copilotkit.actions;
73+
const model = ChatOpenAI({ model: 'gpt-4o' }).bindTools(actions);
74+
75+
// ...
76+
}
77+
```
8278
</Tab>
8379
</Tabs>
8480

docs/content/docs/coagents/advanced/exit-agent.mdx

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,36 +51,34 @@ In this example from [our email-sending app](https://github.com/copilotkit/copil
5151
```
5252
</Tab>
5353
<Tab value="TypeScript">
54-
<InsecurePasswordProtected>
55-
```typescript
56-
import { copilotKitEmitMessage } from "@copilotkit/sdk-js/langchain";
54+
```typescript
55+
import { copilotKitEmitMessage } from "@copilotkit/sdk-js/langchain";
5756

58-
// ...
57+
// ...
5958

60-
async function sendEmailNode(state: EmailAgentState, config: RunnableConfig): Promise<{ messages: any[] }> {
61-
// Send an email.
59+
async function sendEmailNode(state: EmailAgentState, config: RunnableConfig): Promise<{ messages: any[] }> {
60+
// Send an email.
6261

63-
config = copilotKitCustomizeConfig(
64-
config,
65-
{ emitMessages: true },
66-
);
67-
68-
await copilotKitExit(config); // [!code highlight]
62+
config = copilotKitCustomizeConfig(
63+
config,
64+
{ emitMessages: true },
65+
);
6966

70-
// get the last message and cast to ToolMessage
71-
const lastMessage = state.messages[state.messages.length - 1] as ToolMessage;
72-
if (lastMessage.content === "CANCEL") {
73-
await copilotKitEmitMessage(config, "❌ Cancelled sending email.");
74-
} else {
75-
await copilotKitEmitMessage(config, "✅ Sent email.");
76-
}
67+
await copilotKitExit(config); // [!code highlight]
7768

78-
return {
79-
messages: state["messages"],
80-
};
69+
// get the last message and cast to ToolMessage
70+
const lastMessage = state.messages[state.messages.length - 1] as ToolMessage;
71+
if (lastMessage.content === "CANCEL") {
72+
await copilotKitEmitMessage(config, "❌ Cancelled sending email.");
73+
} else {
74+
await copilotKitEmitMessage(config, "✅ Sent email.");
8175
}
82-
```
83-
</InsecurePasswordProtected>
76+
77+
return {
78+
messages: state["messages"],
79+
};
80+
}
81+
```
8482
</Tab>
8583
</Tabs>
8684
</Step>

docs/content/docs/coagents/advanced/intermediate-state-streaming.mdx

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,26 @@ A few key benefits:<br/>
4646
```
4747
</Tab>
4848
<Tab value="TypeScript">
49-
<InsecurePasswordProtected>
50-
```typescript
51-
import { copilotKitEmitState } from '@copilotkit/sdk-js/langchain';
49+
```typescript
50+
import { copilotKitEmitState } from '@copilotkit/sdk-js/langchain';
5251

53-
async function someLanggraphNode(state: AgentState, config: RunnableConfig): Promise<AgentState> {
54-
// ... whatever you want to docs
52+
async function someLanggraphNode(state: AgentState, config: RunnableConfig): Promise<AgentState> {
53+
// ... whatever you want to docs
5554

56-
// modify the state as you please: // [!code highlight:5]
57-
state.logs.push({
58-
message: `Downloading ${resource.url}`,
59-
done: false
60-
});
55+
// modify the state as you please: // [!code highlight:5]
56+
state.logs.push({
57+
message: `Downloading ${resource.url}`,
58+
done: false
59+
});
6160

62-
await copilotKitEmitState(config, state); // manually emit the updated state // [!code highlight:1]
61+
await copilotKitEmitState(config, state); // manually emit the updated state // [!code highlight:1]
6362

64-
// ... keep running your graph
63+
// ... keep running your graph
6564

66-
// finally, return the state from the node as usual. The returned state is the ultimate source of truth // [!code highlight:2]
67-
return state;
68-
}
69-
```
70-
</InsecurePasswordProtected>
65+
// finally, return the state from the node as usual. The returned state is the ultimate source of truth // [!code highlight:2]
66+
return state;
67+
}
68+
```
7169
</Tab>
7270
</Tabs>
7371

@@ -119,41 +117,39 @@ In this example, we're asking for the `outline` state-key to be streamed as it c
119117
```
120118
</Tab>
121119
<Tab value="TypeScript">
122-
<InsecurePasswordProtected>
123-
```typescript
124-
import { copilotKitCustomizeConfig } from '@copilotkit/sdk-js/langchain';
125-
126-
async function streamingStateNode(state: AgentState, config: RunnableConfig): Promise<AgentState> {
127-
const modifiedConfig = copilotKitCustomizeConfig( // [!code highlight:15]
128-
config,
129-
130-
// this will stream the `set_outline` tool-call's `outline` argument, *as if* it was the `outline` state parameter.
131-
// i.e.:
132-
// the tool call: set_outline(outline: string)
133-
// the state: { ..., outline: "..." }
134-
{
135-
emitIntermediateState: [{
136-
stateKey: "outline", // the name of the key on the agent state we want to interact with
137-
tool: "set_outline", // the name of the tool call
138-
toolArgument: "outline", // the name of the argument on the tool call to treat as intermediate state.
139-
}]
140-
}
141-
);
142-
143-
// Pass the modified configuration to LangChain as an argument
144-
const response = await ChatOpenAI({ model: 'gpt-4o' }).invoke(
145-
[...state.messages],
146-
modifiedConfig // pass the modified config // [!code highlight]
147-
);
148-
149-
// Make sure to ALSO return the state from the node.
150-
return {
151-
...state,
152-
outline: outline // <- the actual state object is always the final source of truth when the node ends // [!code highlight]
153-
};
154-
}
155-
```
156-
</InsecurePasswordProtected>
120+
```typescript
121+
import { copilotKitCustomizeConfig } from '@copilotkit/sdk-js/langchain';
122+
123+
async function streamingStateNode(state: AgentState, config: RunnableConfig): Promise<AgentState> {
124+
const modifiedConfig = copilotKitCustomizeConfig( // [!code highlight:15]
125+
config,
126+
127+
// this will stream the `set_outline` tool-call's `outline` argument, *as if* it was the `outline` state parameter.
128+
// i.e.:
129+
// the tool call: set_outline(outline: string)
130+
// the state: { ..., outline: "..." }
131+
{
132+
emitIntermediateState: [{
133+
stateKey: "outline", // the name of the key on the agent state we want to interact with
134+
tool: "set_outline", // the name of the tool call
135+
toolArgument: "outline", // the name of the argument on the tool call to treat as intermediate state.
136+
}]
137+
}
138+
);
139+
140+
// Pass the modified configuration to LangChain as an argument
141+
const response = await ChatOpenAI({ model: 'gpt-4o' }).invoke(
142+
[...state.messages],
143+
modifiedConfig // pass the modified config // [!code highlight]
144+
);
145+
146+
// Make sure to ALSO return the state from the node.
147+
return {
148+
...state,
149+
outline: outline // <- the actual state object is always the final source of truth when the node ends // [!code highlight]
150+
};
151+
}
152+
```
157153
</Tab>
158154
</Tabs>
159155

0 commit comments

Comments
 (0)