mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
32 lines
895 B
TypeScript
32 lines
895 B
TypeScript
import { useMemo } from 'react'
|
|
import type { useMobileStructuredAgentOptions } from './use-mobile-structured-agent-options'
|
|
|
|
type MobileStructuredAgentOptions = ReturnType<typeof useMobileStructuredAgentOptions>
|
|
|
|
/** What command dispatch reads from a chat's options, stable between answers. */
|
|
export function useMobileStructuredCommandController(options: MobileStructuredAgentOptions) {
|
|
const {
|
|
compactInstructions,
|
|
conversationCommands,
|
|
invokeStructuredOption,
|
|
optionSnapshot,
|
|
setStructuredOption
|
|
} = options
|
|
return useMemo(
|
|
() => ({
|
|
snapshot: optionSnapshot,
|
|
setOption: setStructuredOption,
|
|
invokeAction: invokeStructuredOption,
|
|
conversationCommands,
|
|
compactInstructions
|
|
}),
|
|
[
|
|
compactInstructions,
|
|
conversationCommands,
|
|
invokeStructuredOption,
|
|
optionSnapshot,
|
|
setStructuredOption
|
|
]
|
|
)
|
|
}
|