Skip to content

Commit

Permalink
Merge pull request #97 from wxbty/graph
Browse files Browse the repository at this point in the history
Add Graph module for saa
  • Loading branch information
chickenlj authored Nov 7, 2024
2 parents 40f0e10 + 937d68e commit 3a093e5
Show file tree
Hide file tree
Showing 230 changed files with 23,639 additions and 0 deletions.
40 changes: 40 additions & 0 deletions spring-ai-alibaba-graph/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright 2023-2024 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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.alibaba.cloud.ai</groupId>
<artifactId>spring-ai-alibaba</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>spring-ai-alibaba-graph</artifactId>
<packaging>pom</packaging>

<modules>
<module>spring-ai-alibaba-graph-core</module>
<module>spring-ai-alibaba-graph-samples</module>
<module>spring-ai-alibaba-graph-studio</module>
</modules>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 🦜🕸️ SpringAiAlibabaGraph Core

This is the core library for SpringAiAlibabaGraph.
80 changes: 80 additions & 0 deletions spring-ai-alibaba-graph/spring-ai-alibaba-graph-core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<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.alibaba.cloud.ai</groupId>
<artifactId>spring-ai-alibaba</artifactId>
<version>${revision}</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>spring-ai-alibaba-graph-core</artifactId>
<packaging>jar</packaging>
<name>spring-ai-alibaba::core::jdk8</name>
<description>A library for building stateful, multi-agents applications with LLMs</description>


<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>

<!--
<dependency>
<groupId>net.jodah</groupId>
<artifactId>typetools</artifactId>
<version>0.6.3</version>
</dependency>
-->

<dependency>
<groupId>org.bsc.async</groupId>
<artifactId>async-generator-jdk8</artifactId>
<version>2.0.1</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- Specify the Java version
<source>1.8</source>
-->
</configuration>
</plugin>
</plugins>
</reporting>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.alibaba.cloud.ai.graph;

import lombok.Getter;
import com.alibaba.cloud.ai.graph.checkpoint.BaseCheckpointSaver;

import java.util.Optional;

import static java.util.Optional.ofNullable;

public class CompileConfig {

private BaseCheckpointSaver checkpointSaver;

@Getter
private String[] interruptBefore = {};

@Getter
private String[] interruptAfter = {};

public Optional<BaseCheckpointSaver> checkpointSaver() {
return ofNullable(checkpointSaver);
}

public static Builder builder() {
return new Builder();
}

public static class Builder {

private final CompileConfig config = new CompileConfig();

public Builder checkpointSaver(BaseCheckpointSaver checkpointSaver) {
this.config.checkpointSaver = checkpointSaver;
return this;
}

public Builder interruptBefore(String... interruptBefore) {
this.config.interruptBefore = interruptBefore;
return this;
}

public Builder interruptAfter(String... interruptAfter) {
this.config.interruptAfter = interruptAfter;
return this;
}

public CompileConfig build() {
return config;
}

}

private CompileConfig() {
}

}
Loading

0 comments on commit 3a093e5

Please sign in to comment.