Skip to content

Commit

Permalink
Updating to latest release.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmgamble committed Nov 13, 2023
1 parent ea40396 commit 50d36bc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.int13</groupId>
<artifactId>azureai-api-client</artifactId>
<version>0.1.0</version>
<version>0.1.2</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
Copyright (c) 2023 Int13 Consulting Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package ca.int13.azureai.api.classes;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
*
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/ca/int13/azureai/api/client/AzureAIClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ public AzureAIChatResponse sendChatRequest(AzureAIChatRequest chatRequest, Strin
Future<Response> f = client.executeRequest(buildRequest("POST", "chat/completions?api-version=" + apiVersion, gson.toJson(chatRequest), deploymentName));
Response r = f.get();
if (r.getStatusCode() != 200) {

throw new Exception("Could not create chat request - server resposne was " + r.getStatusCode() + " to url: " + url + "chat/completions?api-version=2023-03-15-preview");
System.out.println("Error running sendChatRequest. Input was: " + gson.toJson(chatRequest) + " to deploymentName " + deploymentName);
System.out.println(r.getResponseBody());
throw new Exception("Could not create chat request - server resposne was " + r.getStatusCode() + " to url: " + r.getUri().toUrl());
} else {
// System.out.println(gson.toJson(r.getResponseBody()));
return gson.fromJson(r.getResponseBody(), AzureAIChatResponse.class);
Expand Down

0 comments on commit 50d36bc

Please sign in to comment.