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

Bug: fix generate title function #933

Merged
merged 4 commits into from
Jun 20, 2024
Merged

Bug: fix generate title function #933

merged 4 commits into from
Jun 20, 2024

Conversation

ianlcassidy
Copy link
Contributor

@ianlcassidy ianlcassidy commented Jun 17, 2024

Motivation and Context

The generate_title function in app.py has a few bugs in it.

Description

  • remove use_data kwarg since init_openai_client() no long accepts it
  • remove prompt instructions around outputting the title in JSON format
    • this seems unnecessarily complex and can lead to JSON decode errors
    • just output the title as plain text
  • add exception logging in the function to capture when something fails
  • also added DATASOURCE_TYPE to .env.sample since that controls what data source the tool should use
    • should this default to AzureCognitiveSearch either in .env.sample or backend.settings?

Contribution Checklist

  • I have built and tested the code locally and in a deployed app
  • For frontend changes, I have pulled the latest code from main, built the frontend, and committed all static files.
  • This is a change for all users of this app. No code or asset is specific to my use case or my organization.
  • I didn't break any existing functionality 😄

@ianlcassidy
Copy link
Contributor Author

@microsoft-github-policy-service agree

app.py Show resolved Hide resolved
Copy link
Contributor

@sarah-widder sarah-widder left a comment

Choose a reason for hiding this comment

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

Looks great. Thank you for the contribution!

@ianlcassidy
Copy link
Contributor Author

@sarah-widder feel free to merge when you want, i don't have the ability to.

@sarah-widder sarah-widder merged commit 3bf8484 into microsoft:main Jun 20, 2024
8 checks passed
sudo-init pushed a commit to sudo-init/sample-app-chatGPT that referenced this pull request Sep 20, 2024
nikhilnagaraj pushed a commit to Admin-bh-Edge/Edge-Comp-Policies that referenced this pull request Oct 2, 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