-
Notifications
You must be signed in to change notification settings - Fork 231
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
feat: VoyageAI encoder #255
base: main
Are you sure you want to change the base?
Conversation
thanks @xRiddin — running again |
@xRiddin you can run |
@jamescalam done 👍 |
@jamescalam also the the maximum length of the list is 128 for Voyage AI api. If the user feeds an insane amount of data inside the lists, it will likely throw an error. Need to find a workaround for that. |
Running:
Returns errors (same as being returned in the tests here), seem to only be mocking problems afaict — @xRiddin are you able to resolve? Let us know if you want us to jump in and help on the remaining mocking/tests I also moved |
@jamescalam I'm not able to resolve the mocking problems, any help on the remaining tests are very much appreciated. |
try: | ||
client = voyageai.Client(api_key=api_key) | ||
except Exception as e: | ||
raise ValueError(f"Unable to connect to VoyageAI {e.args}: {e}") from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to help with the test problems, the test is looking to assert the error message outputs as "VOYAGE API client failed to initialize. Error: Initialization error"
but because e.args returns a tuple the output from the failure is actually "Unable to connect to VoyageAI ('Initialization error',): Initialization error"
.
To pass the assertion you could update your test assertion to match the args output or you could update the actual error message to ValueError(f"VOYAGE API client failed to initialize. Error: {e}")
which should pass
|
||
except Exception as e: | ||
logger.error(f"VoyageAI API call failed. Error: {error_message}") | ||
raise ValueError(f"VoyageAI API call failed. Error: {e}") from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last test problems seem to be due to the handling of exceptions in the exponential backoff, currently it will stop on the first exception and not retry at all due to the exception being raised straight away. To get it to continue for the specified number of retries as the test requires you could just add a line to continue the retries before the raise which should pass those other tests
except Exception as e:
logger.error(f"VoyageAI API call failed. Error: {error_message}")
if j < 6:
sleep(2 ** j)
continue
raise ValueError(f"VoyageAI API call failed. Error: {e}") from e
New Feature: Integration of super fast and accurate VoyageAI Embeddings into semantic-router