Skip to content

Commit 40af06b

Browse files
committed
minor copilot optimizations
1 parent 1c836e5 commit 40af06b

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

examples/next-openai/src/app/components/destination-row.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ export function DestinationRow({
1515
onCheckChange,
1616
parentCopilotPointer,
1717
}: DestinationRowProps) {
18-
useMakeCopilotReadable(JSON.stringify(destination), parentCopilotPointer);
18+
const { image, ...destinationParamsToForwardToCopilot } = destination; // we don't want to forward the image, it uselessly clogs the copilot prompt.
19+
destinationParamsToForwardToCopilot["isSelected"] = isChecked; // let's also let the copilot know if this destination is selected or not.
20+
useMakeCopilotReadable(
21+
JSON.stringify(destinationParamsToForwardToCopilot),
22+
parentCopilotPointer
23+
);
1924

2025
return (
2126
<tr key={destination.name}>

examples/next-openai/src/app/components/destination-table.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ export function DestinationTable({
6060
}));
6161
};
6262

63-
const headingCamelCase = toCamelCase(heading);
64-
6563
useMakeCopilotActionable(
6664
{
67-
name: `setSelectedDestinations_${headingCamelCase}`,
65+
name: `setSelectedDestinations_${toCamelCase(heading)}`,
6866
description: `Set the given destinations as 'selected', on the ${heading} table`,
6967
argumentAnnotations: [
7068
{

packages/react-core/src/hooks/use-copilot-chat.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ const previewToken = "TODO123";
8686

8787
export function defaultSystemMessage(contextString: string): string {
8888
return `
89-
Please act as a efficient, competent, and conscientious professional assistant.
90-
You help the user achieve their goals, and you do so in a way that is as efficient as possible, without unnecessary fluff, but also without sacrificing professionalism.
89+
Please act as an efficient, competent, conscientious, and industrious professional assistant.
90+
91+
Help the user achieve their goals, and you do so in a way that is as efficient as possible, without unnecessary fluff, but also without sacrificing professionalism.
9192
Always be polite and respectful, and prefer brevity over verbosity.
9293
9394
The user has provided you with the following context:
@@ -98,6 +99,7 @@ ${contextString}
9899
They have also provided you with functions you can call to initiate actions on their behalf, or functions you can call to receive more information.
99100
100101
Please assist them as best you can.
101-
If you are not sure how to proceed to best fulfill their requests, please ask them for more information.
102+
103+
You can ask them for clarifying questions if needed, but don't be annoying about it. If you can reasonably 'fill in the blanks' yourself, do so.
102104
`;
103105
}

packages/react-ui/src/components/chat-components/default-empty-screen.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export const DefaultEmptyScreen: React.FC<EmptyScreenProps> = (props) => {
2929
return (
3030
<div className="mx-auto max-w-2xl px-4">
3131
<div className="rounded-lg border bg-background p-8">
32-
<h1 className="mb-2 text-lg font-semibold">Welcome to Copilot! 👋</h1>
32+
<h1 className="mb-2 text-lg font-semibold">
33+
Welcome to CopilotKit! 👋
34+
</h1>
3335
<p className="mb-2 leading-normal text-muted-foreground">
3436
This is a Copilot built with{" "}
3537
<ExternalLink href="https://recursively.ai">

0 commit comments

Comments
 (0)