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

Mirascope + Anthropic + Streamlit Website URL Extraction Demo #182

Merged
merged 6 commits into from
Apr 9, 2024

Conversation

willbakst
Copy link
Contributor

@willbakst willbakst commented Apr 6, 2024

  • Uses Mirascope AnthropicExtractor to generate a schema based on a user query.
  • Uses another AnthropicExtractor to extract the generated schema from scraped data from the given url.
  • Streamlit app for easy use and deployment with Ploomber.
  • README blog post

📚 Documentation preview 📚: https://ploomber-doc--182.org.readthedocs.build/en/182/

@willbakst willbakst requested a review from neelasha23 as a code owner April 6, 2024 01:15
@edublancas
Copy link
Contributor

@bryannho please review this

this is a demo + blog post, please review both. once that's done please open a PR to our website repo so we publish the blog post and link to this example

@edublancas
Copy link
Contributor

@neelasha23 please also review

bryannho
bryannho previously approved these changes Apr 9, 2024
Copy link
Contributor

@bryannho bryannho left a comment

Choose a reason for hiding this comment

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

@willbakst Looks great! Drafted a blog post which we'll publish pending @neelasha23's review.

@edublancas Do we want to deploy a live demo as well?

@neelasha23
Copy link
Contributor

A few observations:

  1. Please add the requirements.lock.txt file
  2. Since there is a corresponding PR to blog post, we should remove the blog content from README and include more details on setting up the app locally. Need to add the API keys that should be added as env variables. Also, need to add the URL for generating Anthropic key (https://console.anthropic.com/settings/keys ?)
  3. I think we need credits for running it so I haven't been able to test the functionality
Screenshot 2024-04-09 at 12 59 04 PM

@willbakst @edublancas

@edublancas
Copy link
Contributor

shared an anthropic key via slack

@edublancas
Copy link
Contributor

Since there is a corresponding PR to blog post, we should remove the blog content from README

I think let's keep the post (let's just renamed it to post.md and have a readme.md with a shorter description and essential details). once all observations are addressed and this is merged, we can move this to our website's repo (link from the blog post to this repo), and delete it from here

@willbakst
Copy link
Contributor Author

A few observations:

  1. Please add the requirements.lock.txt file
  2. Since there is a corresponding PR to blog post, we should remove the blog content from README and include more details on setting up the app locally. Need to add the API keys that should be added as env variables. Also, need to add the URL for generating Anthropic key (https://console.anthropic.com/settings/keys ?)
  3. I think we need credits for running it so I haven't been able to test the functionality
Screenshot 2024-04-09 at 12 59 04 PM @willbakst @edublancas
  1. Done
  2. I've renamed the post to post.md as Eduardo suggested and added a true README.md
  3. Yes, you need an API key with credits.

@neelasha23
Copy link
Contributor

Works fine but I think we need to refresh for every query? The first time I tried a new query it displayed the previous query's answers and then an error. but on refreshing the page it shows the correct response.

First attempt (Without refresh). Note that it still displays the painting title and links output of the default query

Screenshot 2024-04-09 at 8 57 04 PM

Second attempt:

Screenshot 2024-04-09 at 8 58 17 PM

@willbakst @edublancas

@willbakst
Copy link
Contributor Author

willbakst commented Apr 9, 2024

@neelasha23 I've just pushed some changes to hopefully fix your concerns:

  1. Your first attempt seems to have hit the token/min limit (which is why it failed).
  2. I've updated the streamlit app so if you change the url or query it should clear the previous output. It will also clear when you hit Extract

@edublancas edublancas merged commit d177c26 into ploomber:main Apr 9, 2024
1 check passed
@edublancas
Copy link
Contributor

@willbakst great work! I'll follow up with the team so we publish this in our blog, will send you the link once it's live!

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.

4 participants