Merge pull request #28 from offendingcommit/feat/dialectic-playground
feat(web): add dialectic reasoning playground
This commit is contained in:
@@ -279,7 +279,21 @@ export function useSearchPeer(workspaceId: string, peerId: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export function useChat(workspaceId: string, peerId: string) {
|
||||
export type ReasoningLevel = "minimal" | "low" | "medium" | "high" | "max";
|
||||
|
||||
export const REASONING_LEVELS: readonly ReasoningLevel[] = [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"max",
|
||||
] as const;
|
||||
|
||||
export function useChat(
|
||||
workspaceId: string,
|
||||
peerId: string,
|
||||
reasoningLevel: ReasoningLevel = "low",
|
||||
) {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async (message: string) => {
|
||||
@@ -287,7 +301,7 @@ export function useChat(workspaceId: string, peerId: string) {
|
||||
"/v3/workspaces/{workspace_id}/peers/{peer_id}/chat",
|
||||
{
|
||||
params: { path: { workspace_id: workspaceId, peer_id: peerId } },
|
||||
body: { query: message, stream: false, reasoning_level: "low" },
|
||||
body: { query: message, stream: false, reasoning_level: reasoningLevel },
|
||||
},
|
||||
);
|
||||
return data ?? err(error);
|
||||
|
||||
Reference in New Issue
Block a user