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

Added inference and a way to retrieve the "File Hints" for assistants #7

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

phact
Copy link
Contributor

@phact phact commented Mar 20, 2024

This PR allows you to create an assistant and run inference against a row from the benchmark.

For #6 to work we needed to be able to get back what files are being used under the hood by Assistants inside a run. OpenAI's Assistants API has a placeholder for this but they don't use it.

From the OpenAI docs:
image

I implemented this functionality in astra-assitants (v0.1.9) and released it datastax/astra-assistants-api#15

To test just run:

python -m swe_bench_util index astra-assistants

@@ -158,3 +158,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
checkouts/
Copy link
Owner

Choose a reason for hiding this comment

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

Good catch

@@ -30,10 +33,9 @@ def upload_file(file_path) -> str | None:
"rb",
),
purpose="assistants",
embedding_model="text-embedding-3-large",
Copy link
Owner

Choose a reason for hiding this comment

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

Just curious, does the embedding model default without this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think default is ada-002. We should get scientific and test out a few out including different providers.

@raymyers
Copy link
Owner

Good stuff, merging. Fixed a small merge conflict that was due to formatting, in the future ruff format should help avoid that. If there's a way that makes it harder to forget to run that would be neat.

@raymyers raymyers merged commit 3f43498 into raymyers:main Mar 20, 2024
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.

2 participants