* Validate the OpenAI API key format
Increase the amount of internal validation for OpenAI API keys. The intent is
to shorten the debugging loop in case of typos. The changes do *not* add
validation for Azure OpenAI API keys.
* Add the validation in `__init__` of `OpenAIClient`.
* Introduce the `MOCK_OPEN_AI_API_KEY` constant for testing.
* Add unit test coverage for the `is_valid_api_key` function.
* Validate the OpenAI API key format
Increase the amount of internal validation for OpenAI API keys. The intent is
to shorten the debugging loop in case of typos. The changes do *not* add
validation for Azure OpenAI API keys.
* Add the validation in `__init__` of `OpenAIClient`.
* Introduce the `MOCK_OPEN_AI_API_KEY` constant for testing.
*Add unit test coverage for the `is_valid_api_key` function.
* Log a warning when register a default client fails.
* Validate the OpenAI API key format
Increase the amount of internal validation for OpenAI API keys. The intent is
to shorten the debugging loop in case of typos. The changes do *not* add
validation for Azure OpenAI API keys.
* Add the validation in `__init__` of `OpenAIClient`. We'll log a
warning when the OpenAI API key isn't valid.
* Introduce the `MOCK_OPEN_AI_API_KEY` constant for testing.
* Add unit test coverage for the `is_valid_api_key` function.
* Check for OpenAI base_url before API key validation
---------
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* implement redis cache mode, if redis_url is set in the llm_config then
it will try to use this. also adds a test to validate both the existing
and the redis cache behavior.
* PR feedback, add unit tests
* more PR feedback, move the new style cache to a context manager
* Update agent_chat.md
* more PR feedback, remove tests from contrib and have them run with the normal jobs
* doc
* updated
* Update website/docs/Use-Cases/agent_chat.md
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* update docs
* update docs; let openaiwrapper to use cache object
* typo
* Update website/docs/Use-Cases/enhanced_inference.md
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* save previous client cache and reset it after send/a_send
* a_run_chat
---------
Co-authored-by: Vijay Ramesh <vijay@regrello.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>