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

Java: Add Gemini ChatCompletion and HuggingFace #6023

Merged
merged 31 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9e0b00e
Add GeminiServiceBuilder and replace calls to OpenAIChatCompletion.bu…
milderhc Apr 24, 2024
1c22b08
Update replace calls to OpenAIChatCompletion.builder()
milderhc Apr 25, 2024
311984d
Update VertexAIChatCompletion
milderhc Apr 28, 2024
d306a1c
Merge 'java-v1' into 'gemini-chatcompletion'
milderhc Apr 28, 2024
92c614f
Update module name
milderhc Apr 28, 2024
eb3325f
Update names
milderhc Apr 28, 2024
c8b54b3
Update
milderhc Apr 28, 2024
6c6e6b2
Initial hugging face implementation
johnoliver Apr 29, 2024
a65bb12
stash
johnoliver Apr 30, 2024
1551ccc
Add ToolCall draft
milderhc Apr 30, 2024
405cede
Merge 'java-development' into gemini-chatcompletion
milderhc May 21, 2024
8455d58
Add PR suggestions
milderhc May 21, 2024
278cad1
Merge remote-tracking branch 'upstream/java-development' into hugging…
johnoliver May 21, 2024
d316b04
Merge remote-tracking branch 'milder/gemini-chatcompletion' into hugg…
johnoliver May 21, 2024
bc75d22
Add ToolCallBehavior options
milderhc May 21, 2024
1cb1a5f
stash
johnoliver May 22, 2024
5a084ac
Fix FunctionDeclaration parameters
milderhc May 23, 2024
23aa3b5
Merge branch 'java-development' of https://github.com/microsoft/seman…
milderhc May 28, 2024
c950b7a
Merge remote-tracking branch 'upstream/java-development' into hugging…
johnoliver May 28, 2024
f24f9a5
Upgrade to 1.1.5-SNAPSHOT
johnoliver May 28, 2024
b85d02a
Add function calling to Gemini
milderhc May 29, 2024
a2d42c5
Fix typo
milderhc May 29, 2024
1ef325c
Apply linting fixes
johnoliver May 29, 2024
a10f8d6
Add GeminiFunctionCall to simplify manual function calling
milderhc May 30, 2024
0ebe859
Merge 'johnoliver/huggingface' into 'gemini-chatcompletion'
milderhc May 30, 2024
0d4a7bf
Rename huggingface module folder
milderhc May 30, 2024
b84255c
Fixes
milderhc May 31, 2024
d74e177
Merge branch 'java-development' of https://github.com/microsoft/seman…
milderhc May 31, 2024
beb9a55
Fixes
milderhc May 31, 2024
502a9aa
Update comments
milderhc May 31, 2024
25d7666
Return Collections.unmodifiableList(geminiFunctionCalls)
milderhc Jun 3, 2024
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
59 changes: 59 additions & 0 deletions java/aiservices/google/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-parent</artifactId>
<version>1.1.6-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>semantickernel-aiservices-google</artifactId>
<name>Semantic Kernel Google Services</name>
<description>Google services for Semantic Kernel</description>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.37.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vertexai</artifactId>
</dependency>

<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-api</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<scope>compile</scope>
</dependency>

<!-- Required for Android -->
<dependency>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft. All rights reserved.
package com.microsoft.semantickernel.aiservices.google;

import com.google.cloud.vertexai.VertexAI;
import com.microsoft.semantickernel.services.AIService;

import javax.annotation.Nullable;

public class GeminiService implements AIService {
private final VertexAI client;
private final String modelId;

protected GeminiService(VertexAI client, String modelId) {
this.client = client;
this.modelId = modelId;
}

@Nullable
@Override
public String getModelId() {
return modelId;
}

@Nullable
@Override
public String getServiceId() {
return null;
}

protected VertexAI getClient() {
return client;
}
}
Loading
Loading