Create a chatgpt client example
- The example provides a possibility to interact with OpenAI
models via ResponseAPI, see the documentation here:
https://developers.openai.com/api/docs/guides/migrate-to-responses
The example implements 2 operations:
- listModels - returns the list of available models.
- createResponse - sends a user request to the chosen model,
returns a response message.
Both operations are defined in the response_api.yaml file.
NOTE: the example reuses official API's naming,
which you can find here:
https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml
But the example doesn't aim to implement entire set of models and
operations, described in the official specification.
For using the example, an OpenAI key is required.
So, before running the binary, please, export the CHAT_OPENAI_KEY environment variable in the following way:
export CHAT_OPENAI_KEY=sk-***
The example provides the list of available models and 4 conversation
modes:
1) Wizard
- the setup behaves as a Wizard and prefers discussing magic
related topics.
2) Scientist
- The setup behaves as Albert Einstein, loves physics.
3) Regular Mode
- The regular chatgpt setup. No additional features.
4) Custom User Mode
- The user can create an own description for the chatgpt behaviour.
Note: SVG resources are downloaded from https://www.freeicons.org/
and used in accordance with their free licenses
(copyrights added in qt_attribution.json).
NOTE: the documentation will be added in followup commits soon.
Pick-to: 6.11
Task-number: QTBUG-143871
Change-Id: If5201ccc9141d66a2792c202d74f8bea4e5c989b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>