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

alttexter-ghclient DEMO #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

jonathanalgar
Copy link
Owner

@jonathanalgar jonathanalgar commented Jan 19, 2024

Let's say we want to bootstrap a docs repo. We have five shiny new docs to start with (1x md, 1x mdx, 3x ipynb borrowed from langchain-ai/langchain for our demo purposes).

All the docs have images, but four are missing something important: alt text and title attributes for those images. (To learn why that's important, see here).

Let's commit and open the PR..

@jonathanalgar jonathanalgar self-assigned this Jan 19, 2024

Choose a reason for hiding this comment

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

Please check the LLM generated alt-text and title attributes in this file as they may contain inaccuracies. Explore how the LLM generated them.

Choose a reason for hiding this comment

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

Please check the LLM generated alt-text and title attributes in this file as they may contain inaccuracies. Explore how the LLM generated them.

Choose a reason for hiding this comment

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

Please check the LLM generated alt-text and title attributes in this file as they may contain inaccuracies. Explore how the LLM generated them.

Choose a reason for hiding this comment

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

Please check the LLM generated alt-text and title attributes in this file as they may contain inaccuracies. Explore how the LLM generated them.

Copy link
Owner Author

@jonathanalgar jonathanalgar Jan 19, 2024

Choose a reason for hiding this comment

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

@jonathanalgar
Copy link
Owner Author

jonathanalgar commented Jan 19, 2024

The alttexter-ghclient doesn't like images without alt text and title attributes. It detects images defined in markdown formatted docs that were added or modified in a PR without alt text and/or title attributes and bundles them off, complete with the doc's text, in a request to the alttexter service to orchestrate generation by the language model.

So after the above commit, four docs were bundled off, one—the only doc where the images had complete alt text and title attributes—wasn't. The principle is that if someone has taken the time to write alt texts and titles for the images in a doc, they won't get overwritten.

It only bundles images of supported type (this currently corresponds to the supported types of gpt-4-vision-preview). So here it skipped the svg badges in one of the docs, for example.

The action handles both images defined locally and images defined by URL (for example).

All docs are handled fully asynchronously, so everything happens quite briskly (but not too briskly to avoid hitting token rate limits); the action took only 49 seconds to run. Granted this is primarily thanks to the model's speed!

The (optionally) returned public LangSmith trace URLs in the review comments are a powerful way to get folks with domain expertise—writing for accessibility in this case—but not necessarily Python expertise interested in improving the prompt. It means someone can click the link, open the model call in the LangSmith Playground and then tweak the prompt to see how that steers the output:

Animated GIF showing the process of editing a prompt in the LangSmith Playground to steer the output of the language model.

Such interaction encourages feedback in the comments both about the specific output with the current prompt and on continuous improvement of the prompt itself.

@jonathanalgar
Copy link
Owner Author

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