vintasoftware / django-ai-assistant

Integrate AI Assistants with Django to build intelligent applications
https://vintasoftware.github.io/django-ai-assistant/
MIT License
204 stars 12 forks source link

Show assistant true name in frontend #78

Closed fjsj closed 2 months ago

fjsj commented 2 months ago

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 have useAssistant and useAssistants? Do same for useThread -> useThreads and useMessage -> useMessages.

Thoughts? @pamella

pamella commented 2 months ago

I'm not sure if I followed. Why will we need two hooks (singular and plural) for each resource?

pamella commented 2 months ago

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?

fjsj commented 2 months ago

yes, I guess that's best.

fjsj commented 2 months ago

but perhaps it's better to be more explicit: useThread vs. useThreadList.

pamella commented 2 months ago

What about the return? Would the names be verbose or more generic? I mean:


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.

fjsj commented 2 months ago

I think verbose. useResouce perhaps too generic, useAIResource seems better?

pamella commented 2 months ago

All right. I think we can go with useThread, useThreadList, and such