Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating sample code to use latest API versions #1829

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@
{
"kind": "ConversationalSummarizationTask",
"parameters": {
"modelVersion": "2022-05-15-preview",
"modelVersion": "latest",
"summaryAspects": [
"Issue",
"Resolution"
]
}
}
]
}
}
6 changes: 3 additions & 3 deletions scenarios/cpp/windows/call-center/call_center.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class CallCenter
{
private:
// This should not change unless you switch to a new version of the Speech REST API.
const std::string speechTranscriptionPath = "/speechtotext/v3.0/transcriptions";
const std::string speechTranscriptionPath = "/speechtotext/v3.1/transcriptions";

// These should not change unless you switch to a new version of the Cognitive Language REST API.
const std::string sentimentAnalysisPath = "/language/:analyze-text";
const std::string sentimentAnalysisQuery = "?api-version=2022-05-01";
const std::string conversationAnalysisPath = "/language/analyze-conversations/jobs";
const std::string conversationAnalysisQuery = "?api-version=2022-05-15-preview";
const std::string conversationSummaryModelVersion = "2022-05-15-preview";
const std::string conversationAnalysisQuery = "?api-version=2022-10-01-preview";
const std::string conversationSummaryModelVersion = "latest";

// How long to wait while polling batch transcription and conversation analysis status.
const int waitSeconds = 10;
Expand Down
6 changes: 3 additions & 3 deletions scenarios/java/jre/console/call-center/CallCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public class CallCenter
private UserConfig _userConfig;

// This should not change unless you switch to a new version of the Speech REST API.
final private static String speechTranscriptionPath = "/speechtotext/v3.0/transcriptions";
final private static String speechTranscriptionPath = "/speechtotext/v3.1/transcriptions";

// These should not change unless you switch to a new version of the Cognitive Language REST API.
final private static String sentimentAnalysisPath = "/language/:analyze-text";
final private static String sentimentAnalysisQuery = "?api-version=2022-05-01";
final private static String conversationAnalysisPath = "/language/analyze-conversations/jobs";
final private static String conversationAnalysisQuery = "?api-version=2022-05-15-preview";
final public static String conversationSummaryModelVersion = "2022-05-15-preview";
final private static String conversationAnalysisQuery = "?api-version=2022-10-01-preview";
final public static String conversationSummaryModelVersion = "latest";

// How long to wait while polling batch transcription and conversation analysis status.
final private static int waitSeconds = 10;
Expand Down
6 changes: 3 additions & 3 deletions scenarios/python/console/call-center/call_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
import user_config_helper

# This should not change unless you switch to a new version of the Speech REST API.
SPEECH_TRANSCRIPTION_PATH = "/speechtotext/v3.0/transcriptions"
SPEECH_TRANSCRIPTION_PATH = "/speechtotext/v3.1/transcriptions"

# These should not change unless you switch to a new version of the Cognitive Language REST API.
SENTIMENT_ANALYSIS_PATH = "/language/:analyze-text";
SENTIMENT_ANALYSIS_QUERY = "?api-version=2022-05-01";
CONVERSATION_ANALYSIS_PATH = "/language/analyze-conversations/jobs";
CONVERSATION_ANALYSIS_QUERY = "?api-version=2022-05-15-preview";
CONVERSATION_SUMMARY_MODEL_VERSION = "2022-05-15-preview";
CONVERSATION_ANALYSIS_QUERY = "?api-version=2022-10-01-preview";
CONVERSATION_SUMMARY_MODEL_VERSION = "latest";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point of using latest, when CONVERSATION_ANALYSIS_QUERY and SPEECH_TRANSCRIPTION_PATH are static.

e.g. when v3.2 comes out, these existing clients will start using the new model version, but the old path and query, is that what you want to happen, or will that just make this more likely to break in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was provided by the Language team. It is likely that the Conversation Summary model version is updated frequently even when the API path remains the same, which would be hard to keep track of.


# How long to wait while polling batch transcription and conversation analysis status.
WAIT_SECONDS = 10
Expand Down