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

Development: Add V2 Messages Endpoint #34

Merged
merged 16 commits into from
Nov 24, 2023
Merged

Development: Add V2 Messages Endpoint #34

merged 16 commits into from
Nov 24, 2023

Conversation

MichaelOwenDyer
Copy link
Contributor

@MichaelOwenDyer MichaelOwenDyer commented Oct 9, 2023

This PR introduces a version 2 of the messages endpoint, which returns all content generated in a guidance program as opposed to just the one variable titled 'response', and additionally accepts just a string as the template parameter instead of an object containing a string and an unused id.

@MichaelOwenDyer
Copy link
Contributor Author

Tried running the formatter but can't seem to get the formatting checks to pass

@dakennguyen
Copy link
Contributor

Tried running the formatter but can't seem to get the formatting checks to pass

you can try to run this poetry run black .

@dakennguyen
Copy link
Contributor

dakennguyen commented Oct 11, 2023

@MichaelOwenDyer I think the endpoint POST /api/v1/messages is currently being used. Will this PR break production? Otherwise, we need to introduce POST /api/v2/messages or make sure it backward backward-compatible.

Other than this, this PR LGTM

@MichaelOwenDyer
Copy link
Contributor Author

You're right, it will break production. There is another PR open on Artemis to change that side as well. But it might actually be smarter to just create a /v2/ endpoint, that way this can be merged without Artemis breaking.

@Hialus
Copy link
Member

Hialus commented Oct 12, 2023

@MichaelOwenDyer I think the endpoint POST /api/v1/messages is currently being used. Will this PR break production? Otherwise, we need to introduce POST /api/v2/messages or make sure it backward backward-compatible.

You're right, it will break production. There is ls1intum/Artemis#7352 open on Artemis to change that side as well. But it might actually be smarter to just create a /v2/ endpoint, that way this can be merged without Artemis breaking.

That is a great idea. I think this would make sense here for the transition phase, until Artemis Prod is updated. Then we could simply remove the v1 endpoint afterwards.

app/services/guidance_wrapper.py Outdated Show resolved Hide resolved
@MichaelOwenDyer
Copy link
Contributor Author

Thanks for the reviews guys. I addressed the issues you pointed out, V1 API should be behaving equivalent to before (although the logic for getting the response variable is now local to the endpoint and not directly in the guidance wrapper). I also extended the message test to test both v1 and v2.

Hialus
Hialus previously requested changes Oct 13, 2023
Copy link
Member

@Hialus Hialus left a comment

Choose a reason for hiding this comment

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

Very nice that you could change this to a v1/v2 split!
Code changes look good, but the linter job is currently failing. Please fix that.

@MichaelOwenDyer
Copy link
Contributor Author

You got it sir. Those dangerously long comments have been shortened.

Copy link
Contributor

@dakennguyen dakennguyen left a comment

Choose a reason for hiding this comment

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

code LGTM!

@MichaelOwenDyer MichaelOwenDyer changed the title Change response type to return all generated content Development: Add V2 Messages API Oct 19, 2023
@MichaelOwenDyer MichaelOwenDyer changed the title Development: Add V2 Messages API Development: Add V2 Messages Endpoint Oct 19, 2023
Copy link
Member

@Hialus Hialus left a comment

Choose a reason for hiding this comment

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

Change look good to me and since it has been deployed to the test server for some time without issues it also is sufficiently tested now.
Great job 🚀

@Hialus Hialus merged commit 74de5c7 into main Nov 24, 2023
22 checks passed
@Hialus Hialus deleted the dict-response branch November 24, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants