Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to prevent reprovisioning of existing agents and the reuploading of files #60

Merged
merged 3 commits into from
Nov 12, 2023

Conversation

FireMMDC
Copy link
Contributor

Adding logic to prevent the duplication of existing agents, and to prevent existing files from being reuploaded.
The script still needs tool integration for agents.

In order to allow for retrieval file modification either the contents of the files can be compared using https://platform.openai.com/docs/api-reference/files/retrieve-contents , or it could be required that whenever a retrieval file needs to be updated its file name should also be updated.

…ent existing files from being reuploaded, still needs tool integration and a process to deal with modifcation to files that have already been uploaded for retrievial
@daveshap
Copy link
Owner

Looks good, I'll ask the community to validate and test.

@@ -14,9 +14,26 @@
if not os.path.exists(agents_path) or not os.path.isdir(agents_path) or not os.listdir(agents_path):
raise ValueError('The "agents" folder is missing, not a directory, or empty.')

existing_assitstants = {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling mistake - should be '..._assistants'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have fixed the spelling thanks!

file_object = client.files.create(file=file_data, purpose='assistants')
files.append({"name": filename, "id": file_object.id})

model = 'gpt-4-1106-preview'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s move the model label onto an environment variable or at least a config file as this will change in the future. We may also want to parameterise it to compare our unit/integration tests against previous versions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a settings.json file to maintain other properties that can be set during the Assistant creation process.
Note: "description" and "metadata" are not currently connected
"tools" is connected for the creation of new Assistants, but not currently handled when updating existing Assistants.

…ilable during the Assistant creation process for an Agent, updated create.py to use model and tools properties present in the new settings.json file
@daveshap daveshap merged commit 0e37044 into daveshap:main Nov 12, 2023
Starblaiz pushed a commit to Starblaiz/OpenAI_Agent_Swarm that referenced this pull request Nov 15, 2023
Attempt to prevent reprovisioning of existing agents and the reuploading of files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants