You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, the current flow of a request through to an OpenAI service relies on simple JSON-serialization of a model to encode the message to BinaryData and send it through the pipeline.
This does not maximize Prompt Caching capabilities, where the completion request should have tools, then history, then new content - in that order.
Additionally, the tools and history must be in the same order every time (suggest alpha order by tool name).
Today, the current flow of a request through to an OpenAI service relies on simple JSON-serialization of a model to encode the message to
BinaryData
and send it through the pipeline.This does not maximize Prompt Caching capabilities, where the completion request should have
tools
, thenhistory
, then new content - in that order.Additionally, the tools and history must be in the same order every time (suggest alpha order by tool name).
Sources:
https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/prompt-caching
https://openai.com/index/api-prompt-caching/
https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/prompt-caching#what-is-cached
Asks for
BinaryData
from the options:azure-sdk-for-java/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java
Line 726 in cc459ee
Which simply uses a default serialization implementation to turn the CompletionChatOptions into BinaryData
azure-sdk-for-java/sdk/core/azure-core/src/main/java/com/azure/core/util/BinaryData.java
Lines 614 to 615 in cc459ee
azure-sdk-for-java/sdk/core/azure-core/src/main/java/com/azure/core/util/BinaryData.java
Line 181 in cc459ee
Additional context
microsoft/semantic-kernel#9444
openai/openai-dotnet#281
The text was updated successfully, but these errors were encountered: