Skip to content

Commit 7f80cef

Browse files
committed
minor
.
1 parent 70056c0 commit 7f80cef

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

packages/react-core/src/components/copilot-provider.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"use client";
2-
import React, { useState, ReactNode, useCallback } from "react";
3-
import { AnnotatedFunction } from "../types/annotated-function";
4-
import useTree from "../hooks/use-tree";
5-
import { CopilotContext } from "../context/copilot-context";
62
import { FunctionCallHandler } from "ai";
73
import { ChatCompletionFunctions } from "openai-edge/types/api";
4+
import { ReactNode, useCallback, useState } from "react";
5+
import { CopilotContext } from "../context/copilot-context";
6+
import useTree from "../hooks/use-tree";
7+
import { AnnotatedFunction } from "../types/annotated-function";
88

99
export function CopilotProvider({
1010
children,
@@ -45,7 +45,7 @@ export function CopilotProvider({
4545
);
4646

4747
const addContext = useCallback(
48-
(context: string, categories: string[] = ["global"], parentId?: string) => {
48+
(context: string, parentId?: string, categories: string[] = ["global"]) => {
4949
return addElement(context, categories, parentId);
5050
},
5151
[addElement]

packages/react-core/src/context/copilot-context.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"use client";
22

3+
import { FunctionCallHandler } from "ai";
4+
import { ChatCompletionFunctions } from "openai-edge/types/api";
35
import React from "react";
4-
import { AnnotatedFunction } from "../types/annotated-function";
56
import { TreeNodeId } from "../hooks/use-tree";
6-
import { ChatCompletionFunctions } from "openai-edge/types/api";
7-
import { FunctionCallHandler } from "ai";
7+
import { AnnotatedFunction } from "../types/annotated-function";
88

99
export interface CopilotContextParams {
1010
// function-calling
@@ -18,8 +18,8 @@ export interface CopilotContextParams {
1818
getContextString: (categories?: string[]) => string;
1919
addContext: (
2020
context: string,
21-
categories?: string[],
22-
parentId?: string
21+
parentId?: string,
22+
categories?: string[]
2323
) => TreeNodeId;
2424
removeContext: (id: TreeNodeId) => void;
2525
}

packages/react-core/src/hooks/use-make-copilot-readable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { useRef, useContext, useEffect } from "react";
3+
import { useContext, useEffect, useRef } from "react";
44
import { CopilotContext } from "../context/copilot-context";
55

66
/**
@@ -19,7 +19,7 @@ export function useMakeCopilotReadable(
1919
const idRef = useRef<string>();
2020

2121
useEffect(() => {
22-
const id = addContext(information, categories, parentId);
22+
const id = addContext(information, parentId, categories);
2323
idRef.current = id;
2424

2525
return () => {

packages/react-core/src/hooks/use-tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { nanoid } from "nanoid";
2-
import { useReducer, useCallback } from "react";
2+
import { useCallback, useReducer } from "react";
33

44
export type TreeNodeId = string;
55

0 commit comments

Comments
 (0)