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

add text-followup.schema.json for text-followup preprocessor #932

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

jeffbl
Copy link
Member

@jeffbl jeffbl commented Dec 18, 2024

This is the new schema for the text-followup preprocessor that will be PR'ed soon (#918). Since this is a new schema, it should not impact any other components.

This is a new file, but not a new component, so does not requie any CI/CD integration. That will come when #918 is completed.
The schema was tested with an override on unicorn for text-followup preprocessor, currently in a branch of the same name, including schema validation of the LLM results against this schema. For example, JSON printed in debug output:

orchestrator-1                    | 2024-12-18T17:50:40.515048959Z [Timing] Preprocessor "text-followup": Execution Time: 2.395 ms, CPU Time: 2.43 ms, Normalized CPU Usage: 6.341%
text-followup-1                   | 2024-12-18T17:50:40.516095689Z [2024-12-18 17:50:40 +0000] [7] [DEBUG] POST /preprocessor
text-followup-1                   | 2024-12-18T17:50:40.516436176Z DEBUG:root:Received request
text-followup-1                   | 2024-12-18T17:50:40.522360726Z DEBUG:root:OLLAMA_URL https://ollama.pegasus.cim.mcgill.ca/ollama/api/generate
text-followup-1                   | 2024-12-18T17:50:40.522375474Z DEBUG:root:OLLAMA_API_KEY looks properly formatted: sk-[redacted]
text-followup-1                   | 2024-12-18T17:50:40.522382527Z DEBUG:root:serializing json from request_data dictionary
text-followup-1                   | 2024-12-18T17:50:40.523134495Z DEBUG:root:Posting request to ollama model llama3.2-vision:latest
text-followup-1                   | 2024-12-18T17:50:40.524966675Z DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): ollama.pegasus.cim.mcgill.ca:443
text-followup-1                   | 2024-12-18T17:50:43.031259972Z DEBUG:urllib3.connectionpool:https://ollama.pegasus.cim.mcgill.ca:443 "POST /ollama/api/generate HTTP/11" 200 1791
text-followup-1                   | 2024-12-18T17:50:43.031480164Z DEBUG:root:ollama request response code: 200
text-followup-1                   | 2024-12-18T17:50:43.032070299Z DEBUG:root:{'request_uuid': 'c4274fd8-eb6a-4baf-a4fe-79f191a88a7e', 'timestamp': 1734544240, 'name': 'ca.mcgill.a11y.image.preprocessor.text-followup', 'data': {'response_brief': 'The two women are sitting at a table with notebooks and pens.', 'response_full': 'They appear to be engaged in a conversation or meeting, possibly discussing work-related topics or sharing ideas. The woman on the left is holding a pen and appears to be taking notes, while the woman on the right is smiling and gesturing with her hand. The overall atmosphere suggests a collaborative and productive interaction between the two individuals.'}}
orchestrator-1                    | 2024-12-18T17:50:43.033662990Z Waiting for handlers...
orchestrator-1                    | 2024-12-18T17:50:43.033683108Z Valid response generated.


Please ensure you've followed the checklist and provide all the required information before requesting a review.
If you do not have everything applicable to your PR, it will not be reviewed!
If you don't know what something is or if it applies to you, ask!

Don't delete below this line.


Required Information

  • I referenced the issue addressed in this PR.
  • I described the changes made and how these address the issue.
  • I described how I tested these changes.

Coding/Commit Requirements

  • I followed applicable coding standards where appropriate (e.g., PEP8)
  • I have not committed any models or other large files.

New Component Checklist (mandatory for new microservices)

  • I added an entry to docker-compose.yml and build.yml.
  • I created A CI workflow under .github/workflows.
  • I have created a README.md file that describes what the component does and what it depends on (other microservices, ML models, etc.).

OR

  • I have not added a new component in this PR.

@jeffbl
Copy link
Member Author

jeffbl commented Dec 18, 2024

Since response_full is now optional in this schema, we need to change the LLM prompt to omit this tag if it cant provide anything meaningful for further details.

Copy link
Collaborator

@JRegimbal JRegimbal left a comment

Choose a reason for hiding this comment

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

Looks good!

@JRegimbal JRegimbal merged commit f11a23d into schemas Dec 20, 2024
1 check passed
@JRegimbal JRegimbal deleted the text-followup.schema branch December 20, 2024 13:42
@jeffbl jeffbl added the deploy! deploy into production from test! label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy! deploy into production from test!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants