openai-assistant v2.0.4
v2.0.4 changes:
Changes to Openai_API methods setup() and file_upload():
Compose instructions and include FURTHER_INSTRUCTIONS:
* instructions = f"You are {self.assistant_name}, {self.your_name}'s personal AI assistant."
* further = (self.config.get("FURTHER_INSTRUCTIONS") or "").strip()
* if further: instructions = f"{instructions}\n\n{further}"
Update assistant with vector store and sync instructions in a single call:
* Build update_kwargs with tool_resources.
* If assistant.instructions != instructions, include "instructions" in update_kwargs.
* Call self.client.beta.assistants.update(**update_kwargs).
* When the assistant’s instructions need updating (due to changes in YOUR_NAME or FURTHER_INSTRUCTIONS),
the app will now print:
Synced assistant instructions with settings (YOUR_NAME and FURTHER_INSTRUCTIONS).
This message only appears if instructions were actually changed during setup; otherwise, it stays quiet.
Added robust error handling and logging for vector store upload and streaming.
* Upload failures no longer crash startup; a clear status is returned and printed by the main flow.
* Assistant update issues don’t prevent the app from starting a chat; you’ll see a clear warning.
* Streaming now has a safety net for unforeseen errors, with logging to help diagnose.