Skip to content

fix: fix bugs and update openai_compatible_model #2287

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fengju0213
Copy link
Collaborator

Description

Actually, self.page_url in code below does not get updated during the use of BrowserToolkit, so I've temporarily removed this method.

result = video_analyzer.ask_question_about_video(
            self.page_url, question
        )

Additionally, the BadRequest issue that might occur in OpenAICompatibleModel has been resolved.

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

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

I think visit_page method updates self.page_url?

@fengju0213
Copy link
Collaborator Author

I think visit_page method updates self.page_url?

This parameter was updated here, but methods like click were not.

Comment on lines -513 to -528
def ask_question_about_video(self, question: str) -> str:
r"""Ask a question about the video on the current page,
such as YouTube video.
Args:
question (str): The question to ask.
Returns:
str: The answer to the question.
"""
video_analyzer = VideoAnalysisToolkit()
result = video_analyzer.ask_question_about_video(
self.page_url, question
)
return result

Copy link
Member

Choose a reason for hiding this comment

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

instead of removing this function, I think we can just fix the bug to remain the original functionality

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