Skip to content

Commit e76ce9e

Browse files
committed
example updates and rounded banner
1 parent 1ddfa9b commit e76ce9e

2 files changed

Lines changed: 44 additions & 28 deletions

File tree

README.md

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div align="center">
2-
<img src="./assets/banner.png" width="300" style="border-radius: 10px;">
2+
<img src="./assets/banner.png" width="200">
33
</div>
44

55
# CopilotKit
66

7-
Add a powerful & customizable copilot to any app, in an afternoon.
7+
Add a powerful & hackable copilot to any app, in an afternoon.
88

99
## Installation
1010

@@ -15,7 +15,7 @@ pnpm install @copilotkit/react-core @copilotkit/react-ui
1515
## Examples
1616

1717

18-
### Integrate copilot (2 lines of code)
18+
### Integrate copilot
1919

2020
```typescript
2121
import { CopilotProvider } from "@copilotkit/react-core";
@@ -24,60 +24,62 @@ import { CopilotSidebarUIProvider } from "@copilotkit/react-ui";
2424
export default function App(): JSX.Element {
2525
return (
2626
<CopilotProvider> {/* Global state & business logic. Put this around the entire app */}
27-
<CopilotSidebarUIProvider> {/* A built-in Copilot UI (or bring your own UI). Put this around the entire app, or around individual pages. */}
27+
<CopilotSidebarUIProvider> {/* A built-in Copilot UI (or bring your own UI). Put around individual pages, or the entire app. */}
2828
<YourContent />
2929
</CopilotSidebarUIProvider>
3030
</CopilotProvider>
3131
);
3232
}
3333
```
3434

35-
### Let the copilot read the current state of your app
35+
### Give the copilot read permissions
3636

3737
```typescript
3838
import { useMakeCopilotReadable } from "@copilotkit/react-core";
3939

4040
function Department(props: DepartmentProps): JSX.Element {
4141
const { departmentData, employees } = props;
4242

43-
// Give the copilot information about this department. Keep the pointer, to easily associate employees w departments.
43+
// Give the copilot information about this department. Keep the pointer, to associate employees w departments.
4444
const departmentCopilotPointer = useMakeCopilotReadable(departmentData.description());
4545

4646
return ( // Render as usual.
4747
<>
48-
<h1>{props.departmentData.departmentName}</h1>
49-
50-
<h2>Employees:</h2>
51-
48+
{/* ... */}
49+
5250
{employees.map((employeeData) => (
5351
<Employee
5452
employeeData={employeeData}
55-
departmentCopilotPointer={departmentCopilotPointer} // pass the copilot pointer
53+
copilotParentPointer={departmentCopilotPointer} // pass the copilot pointer
5654
/>
5755
))}
5856
</>
5957
);
6058
}
6159

6260
function Employee(props: EmployeeProps): JSX.Element {
63-
const { employeeData, departmentCopilotPointer } = props;
61+
const { employeeData, copilotParentPointer } = props;
6462

65-
// Give the copilot information about this employee.
66-
useMakeCopilotReadable(employeeData.description(), departmentCopilotPointer);
63+
// Give the copilot information about this employee, and associate it with its parent department.
64+
useMakeCopilotReadable(employeeData.description(), copilotParentPointer);
6765

6866
return ( // Render as usual.
69-
<h2>{employeeData.employeeName}</h2>
67+
<>
68+
{/* ... */}
69+
</>
7070
);
7171
}
7272
```
7373

74-
### Let the copilot interact with your app
74+
### Give the copilot write permissions
7575

7676
```typescript
7777
import { useMakeCopilotActionable } from "@copilotkit/react-core";
7878

79-
function DepartmentComponent(props: DepartmentComponentProps): JSX.Element {
80-
// Give the copilot an entrypoint to take action on behalf of the user.
79+
function Department(props: DepartmentProps): JSX.Element {
80+
// ...
81+
82+
// Let the copilot take action on behalf of the user.
8183
useMakeCopilotActionable(
8284
{
8385
name: "setEmployeesAsSelected",
@@ -96,22 +98,36 @@ function DepartmentComponent(props: DepartmentComponentProps): JSX.Element {
9698

9799

98100

99-
## Key entrypoints:
101+
## Demo
102+
103+
CopilotKit in action.
100104

101-
- Implemented
102-
- `useMakeCopilotReadable`: give static information to the copilot, in sync with on-screen state
103-
- `useMakeCopilotActionable`: allow the copilot to control the state of the application
105+
![Demo Gif](./assets/demo.gif)
104106

105-
- Coming soon
106-
- `useMakeCopilotAskable`: let the copilot ask for additional information when needed
107-
- `useSetCopilotMessage`: edit the (unsent) typed user message to the copilot
108107

108+
## Roadmap
109109

110-
## Demo
110+
### Hooks
111+
-`useMakeCopilotReadable`: give static information to the copilot, in sync with on-screen state
112+
-`useMakeCopilotActionable`: Let the copilot take action on behalf of the user
113+
- 🚧 `useMakeCopilotAskable`: let the copilot ask for additional information when needed (coming soon)
114+
- 🚧 `useSetCopilotMessage`: edit the (unsent) typed user message to the copilot (coming soon)
111115

112-
CopilotKit in action.
116+
### UI components
117+
-`<CopilotSidebarUIProvider>`: Built in, hackable Copilot UI (optional - you can bring your own UI).
118+
- 🚧 `<AutocompleteTextArea {...} />`: a GitHubCopilot-style intelligent autocomplete text area (coming soon).
113119

114-
![Demo Gif](./assets/demo.gif)
120+
### Integrations
121+
- ✅ Vercel AI SDK
122+
- ✅ OpenAI APIs
123+
- 🚧 Langchain
124+
- 🚧 Additional LLM providers
125+
126+
### Frameworks
127+
- ✅ React
128+
- 🚧 Vue
129+
- 🚧 Svelte
130+
- 🚧 Swift (Mac + iOS)
115131

116132
## Contribute
117133

assets/banner.png

432 KB
Loading

0 commit comments

Comments
 (0)