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

Implement standalone chat detection API for text #210

Closed
4 tasks
evaline-ju opened this issue Sep 26, 2024 · 3 comments · Fixed by #233
Closed
4 tasks

Implement standalone chat detection API for text #210

evaline-ju opened this issue Sep 26, 2024 · 3 comments · Fixed by #233
Assignees
Labels
enhancement New feature or request

Comments

@evaline-ju
Copy link
Collaborator

evaline-ju commented Sep 26, 2024

Description

As a followup to #195, as an orchestrator developer, I want to implement the changes for the updated API, so that I can provide standalone detections on chat. This endpoint is designed for detectors working on full chat histories

Tasks

  1. Implement standalone detector endpoint /text/detection/chat (accepting chat history request) in orchestrator
  2. Add http client for detection_chat
  3. Test with dummy detector that works on full chat histories

Acceptance Criteria

  • Unit tests cover new/changed code
  • Examples build against new/changed code
  • READMEs are updated
  • Type of semantic version change is identified
@evaline-ju evaline-ju added the enhancement New feature or request label Sep 26, 2024
@mdevino mdevino self-assigned this Oct 7, 2024
@mdevino
Copy link
Collaborator

mdevino commented Oct 7, 2024

The API wasn't very clear o a few things to me, so I'm looking here.

  1. Do we need to support deprecated fields (Assistant message's function_call, Function message)?

image

  1. Will we support all modalities for this endpoint? e.g.: For User messages' content array variant, will we support both text and image?

image

@evaline-ju evaline-ju changed the title Implement standalone chat detection API Implement standalone chat detection API for text Oct 7, 2024
@evaline-ju
Copy link
Collaborator Author

We’re using the openAI messages object directly, so the oneOf with the deprecation will be applied for now https://github.com/openai/openai-openapi/blob/master/openapi.yaml#L9264-L9270

I’m going to answer these backwards since I think it makes more sense

Will we support all modalities for this endpoint? e.g.: For User messages' content array variant, will we support both text and image?

We can start off with this for text particularly [I’ve updated the title of the issue, also the standalone detection endpoint we have now is just /text/chat and the orchestrator standalone endpoint is /text/detection/chat]. If/when we add image modality support in the detectors API, we can consider the image_url and such in mixed or multi-modality support.

Do we need to support deprecated fields (Assistant message's function_call, Function message)?

Because this is pretty much just a passthrough of message history, we can keep any content as is as much as possible. Note that this endpoint is meant firstly for detectors that take whole chat history, and not processing individual content messages with detectors.

@gkumbhat
Copy link
Collaborator

gkumbhat commented Oct 7, 2024

@mdevino the standalone API is mainly targeted to support chat as the input. It doesn't necessarily have to be processed by a chat completion model implementing open-ai API etc. So, parameter wise, we don't need to worry about any of those parameters. If such parameters are supported by the underlying model, then we would basically do a passthrough, as @evaline-ju mentioned.

We decided to use "messages" format more closely to open-ai to make it easier for users to pass their already formatted data.

@evaline-ju evaline-ju linked a pull request Oct 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants