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

fix: more tolerance for ai response in opportunity creation ❗️ #678

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

ramiAbdou
Copy link
Member

@ramiAbdou ramiAbdou commented Dec 12, 2024

Description ✏️

This PR fixes a couple issues with the opportunity creation from Slack:

  • Allows the company field to be null if the AI cannot determine the company name from text (happens when there is no mention of the company in the website text content).
  • Fixes the ability to retry creation of an opportunity. Previously the on conflict do nothing would negate the returning statement, which meant the function would throw an error.
  • Separates the JSON parsing from the Zod parsing, to be clearer about where the function failed. Also added some logs in case of failure.

Type of Change 🐞

  • Feature - A non-breaking change which adds functionality.
  • Fix - A non-breaking change which fixes an issue.
  • Refactor - A change that neither fixes a bug nor adds a feature.
  • Documentation - A change only to in-code or markdown documentation.
  • Tests - A change that adds missing unit/integration tests.
  • Chore - A change that is likely none of the above.

Checklist ✅

  • I have done a self-review of my code.
  • I have manually tested my code (if applicable).
  • I have added/updated any relevant documentation (if applicable).

@ramiAbdou ramiAbdou self-assigned this Dec 12, 2024
@ramiAbdou ramiAbdou marked this pull request as ready for review December 12, 2024 18:21
@ramiAbdou ramiAbdou changed the title fix: more tolerance from ai response in opportunity creation ❗️ fix: more tolerance fpr ai response in opportunity creation ❗️ Dec 12, 2024
@ramiAbdou ramiAbdou changed the title fix: more tolerance fpr ai response in opportunity creation ❗️ fix: more tolerance for ai response in opportunity creation ❗️ Dec 12, 2024
@ramiAbdou ramiAbdou merged commit f80fd35 into main Dec 12, 2024
2 checks passed
@ramiAbdou ramiAbdou deleted the rami/opportunity-fix branch December 12, 2024 18:22
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.

1 participant