fix: 1634 fix image description service #1667
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to:
[(https://github.com//issues/1643 ]
)
Risks
Low
Background
What does this PR do?
Since Image Description Service uses recognizeWithOpenAI function, it won't work if the model provider used by the agent is anything else than OpenAI.
What kind of change is this?
Check if OpenAI is the provider used, if it is, use that endpoint, if not use openAI default endpoint for image descriptions.
Documentation changes needed?
Testing
I cloned a fresh repo from the release 1.7 and ran a default character with twitter client. My .env contained an Openai API key and I used a venice API model for my agent. I got authentication error (see issue 1634 post when trying to get image description from a twitter post.
NOTE : This only fixes the authentification issue, the agent still won't be able to get the description from images in a twitter post. I will create a seperate issue and PR to solve this issue shortly.
Where should a reviewer start?
Detailed testing steps
I ran pnpm test and pnpm lint locally but did not include them in the PR since only 1 file is changed.
Discord username
displayed name : nusko Discord nametag : nusko_