GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-sdk/MIGRATION.md at develop · codingwangfeng/java-sdk

Expand file tree

/

MIGRATION.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
97 lines (76 loc) · 2.61 KB
/

MIGRATION.md

Copy path

File metadata and controls

97 lines (76 loc) · 2.61 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

4.0

Conversation

  • No old version dates -- just current

  • All methods now take options objects, e.g.:

    MessageRequest request = new MessageRequest.Builder()
      .inputText(message)
      .build();
    service.message(workspaceId, request).execute();

    is now:

    MessageOptions messageOptions = new MessageOptions.Builder()
      .workspaceId(workspaceId)
      .input(new InputData.Builder(message).build())
      .build();
    service.message(messageOptions).execute();
  • Context is now a formal class that extends map.

  • Many classes have been renamed - mostly dropping "Response" from classnames.

    • EntityResponse is now Entity
    • ExampleResponse is now Example
    • IntentResponse is now Intent
    • WorkspaceResponse is now Workspace

    This renaming was done for simplicity and to improve consistency across SDKs going forward.

  • Counterexample now has its own classes no longer overloaded on Example

Tone Analyzer

  • The method getTone() was replaced with: tone().

    For example:

    public ServiceCall<ToneAnalysis> getTone(String text, ToneOptions options)

    Is now:

    public ServiceCall<ToneAnalysis> tone(ToneOptions options)

    tone() example:

    ToneOptions toneOptions = new ToneOptions.Builder()
      .text(text)
      .build();
    ToneAnalysis tone = service.tone(toneOptions).execute();
  • The method getToneChat() was replaced with: toneChat().

    For example:

    public ServiceCall<ToneAnalysis> getChatTone(ToneChatRequest options)

    Is now:

    public ServiceCall<UtteranceAnalyses> chatTone(ToneChatOptions options) {

    chatTone() example:

    String[] texts = {
      "My charger isn't working.",
      "Thanks for reaching out. Can you give me some more detail about the issue?",
      "I put my charger in my tablet to charge it up last night and it keeps saying it isn't"
          + " charging. The charging icon comes on, but it stays on even when I take the charger out. "
          + "Which is ridiculous, it's brand new.",
      "I'm sorry you're having issues with charging. What kind of charger are you using?"
    };
    
    List<Utterance> utterances = new ArrayList<>();
    for (int i = 0; i < texts.length; i++) {
      Utterance utterance = new Utterance.Builder()
        .text(texts[i])
        .user(users[i])
        .build();
      utterances.add(utterance);
    }
    ToneChatOptions toneChatOptions = new ToneChatOptions.Builder()
      .utterances(utterances)
      .build();
    
    // Call the service
    UtteranceAnalyses utterancesTone = service.toneChat(toneChatOptions).execute();
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.