microsoft / aoai-api-simulator

A sample showing how to create a simulated API implementation for Azure OpenAI (AOAI)
MIT License
10 stars 10 forks source link

Add support for image generation endpoint #13

Open stuartleeks opened 2 months ago

stuartleeks commented 2 months ago

See https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#image-generation

(from https://github.com/stuartleeks/aoai-simulated-api/issues/48)

martinpeck commented 2 months ago

Questions:

  1. how many variations of images do we need?
  2. I assume that we don't need to show a "relevant" image. Correct?
  3. There are two ways images can be returned: as a URL or as Base64. Does the URL need to resolve to anything?
  4. If the url needs to resolve, do we need to create all of the sizes, image types etc? I don't see any need (I can't imagine that this will impact perf testing or other load testing.
stuartleeks commented 2 months ago
  1. how many variations of images do we need? I guess we can start with one for the initial implementation and add more later?

  2. I assume that we don't need to show a "relevant" image. Correct? Correct - if we're faking the image then it doesn't need to be relevant.

  3. There are two ways images can be returned: as a URL or as Base64. Does the URL need to resolve to anything? I think it would be good for the URL to resolve to an endpoint in the API that will serve up the image content. That way any client calling the API and getting the URL can still follow the URL to get the content

  4. If the url needs to resolve, do we need to create all of the sizes, image types etc? I don't see any need (I can't imagine that this will impact perf testing or other load testing. As with image variation, I suggest we start simple and expand later

stuartleeks commented 2 months ago

For the record/replay mode, I imagine that the base64 image option should just work. For the url response the recorder will need to do some work to change the returned URL in the response so that it resolves via the simulator (and can then record the request to the image URL as well)