Closed fjsj closed 2 months ago
I'm not sure if I followed. Why will we need two hooks (singular and plural) for each resource?
Oh, would the singular named hook exist to handle a specific instance of the resource?
For example, would useThread({ threadId: 1})
return thread
, deleteThread
, etc, all associated with the threadId
?
yes, I guess that's best.
but perhaps it's better to be more explicit: useThread
vs. useThreadList
.
What about the return? Would the names be verbose or more generic? I mean:
thread
, fetchThread
, deleteThread
thread
, fetch
, delete
Also, I don't know if it's good timing, but we could have something like useResouce({ resourceType, resourceId })
which would use the generic naming for the returned items. But I guess we can leave this for later, once the functionalities are more stable because the available returned items may differ depending on the resource type.
I think verbose.
useResouce
perhaps too generic, useAIResource
seems better?
All right. I think we can go with useThread
, useThreadList
, and such
Instead of only the id as it is now in example/assets/js/components/Chat/Chat.tsx.
Will require a new hook probably? Instead of
useAssistant
, we can haveuseAssistant
anduseAssistants
? Do same foruseThread
->useThreads
anduseMessage
->useMessages
.Thoughts? @pamella