- Issue created by @marcus_johansson
- 🇬🇧United Kingdom yautja_cetanu
I'm guessing we need it to work with some tokeniser too? Am I right that different models have different approaches to tokens? So if we give a realistic response for "max_tokens" to be perfect we'd need a tokeniser for each model? Should we just pick a specific tokeniser likes Chatgpt 4o's one so its roughly correct?
- 🇩🇪Germany marcus_johansson
This one will actually just mock OpenAI - since its the most used one and since many follows the same standard, its enough to have some testing for now. If we need to mock Huggingface, that is a huge effort, so this will be ok for now I think.
The other option we can look into is writing json template for https://github.com/mockoon/mockoon and have it running as a Mockoon service.
- 🇩🇪Germany marcus_johansson
I looked into https://github.com/mockoon/mockoon and it seems to have everything we need. To not reinvent the wheel it makes sense to use this or any other generic open source mocking tool.
Mockoon is great though because it:
1. Is open source.
2. Its nodejs, which I think more Drupal developers knows then Java that is based for other populat mockup frameworks (wiremock, mockserver).
3. It had Docker images prepared which means DDEV and testing integrations are easy.
4. It does not run on YAML configurations, but JSON, which is a little bit harder to read/write, but its the native response of most API's, so it kind of makes sense for comparisons.
5. It can do delays of responses to mock OpenAI's latency.
6. It can do static file responses to mock urls for text-to-image responses.
7. If it would fail something it still has a proxy option to setup custom endpoints.
8. It has an enterprise SaaS behind it that could sponsor with setups, even though its easy enough to setup in Gitlab.I would say that researching some complex test endpoint for a more complex test would make sense to see if the project holds everything it promises.
One example would be a typical Text To Image, where you would have to do it in two steps:
1. First you do a text-to-image call that should fail and work according to the specification above, including checking the bearer token.
2. Then you do a secondary call to get the "generated" static image, based on the resolution.If this is possible to mockup, with possible error responses for unvalid api key, missing prompt etc. I would say that it is enough to use this.
- Status changed to Fixed
3 months ago 7:46am 26 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.