Skip to content

Commit

Permalink
remove 'core' package. rename llm package to client
Browse files Browse the repository at this point in the history
  • Loading branch information
markpollack committed Aug 15, 2023
1 parent 0e0c4b9 commit 2682e0e
Show file tree
Hide file tree
Showing 49 changed files with 112 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import com.azure.ai.openai.models.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.core.llm.AiClient;
import org.springframework.ai.core.llm.AiResponse;
import org.springframework.ai.core.llm.Generation;
import org.springframework.ai.core.prompt.Prompt;
import org.springframework.ai.core.prompt.messages.Message;
import org.springframework.ai.client.AiClient;
import org.springframework.ai.client.AiResponse;
import org.springframework.ai.client.Generation;
import org.springframework.ai.prompt.Prompt;
import org.springframework.ai.prompt.messages.Message;
import org.springframework.util.Assert;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.springframework.ai.core.chain;
package org.springframework.ai.chain;

import org.springframework.ai.core.memory.Memory;
import org.springframework.ai.memory.Memory;

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.springframework.ai.core.chain;
package org.springframework.ai.chain;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

package org.springframework.ai.core.llm;
package org.springframework.ai.client;

import org.springframework.ai.core.prompt.Prompt;
import org.springframework.ai.core.prompt.messages.UserMessage;
import org.springframework.ai.prompt.Prompt;
import org.springframework.ai.prompt.messages.UserMessage;

@FunctionalInterface
public interface AiClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ai.core.llm;
package org.springframework.ai.client;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

package org.springframework.ai.core.llm;
package org.springframework.ai.client;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class Generation {

// Just text for now
private final String text;

private Map<String, Object> info;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.springframework.ai.core.document;
package org.springframework.ai.document;

import org.springframework.util.StringUtils;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.springframework.ai.core.document;
package org.springframework.ai.document;

import java.util.List;
import java.util.function.Function;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.springframework.ai.core.document;
package org.springframework.ai.document;

public enum MetadataMode {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.springframework.ai.core.embedding;
package org.springframework.ai.embedding;

import java.util.List;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.springframework.ai.core.embedding;
package org.springframework.ai.embedding;

import org.springframework.ai.core.document.Document;
import org.springframework.ai.document.Document;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.springframework.ai.core.embedding;
package org.springframework.ai.embedding;

import java.util.HashMap;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.springframework.ai.loader;

import org.springframework.ai.document.Document;
import org.springframework.ai.splitter.TextSplitter;

import java.util.List;

public interface Loader {

List<Document> load();

List<Document> load(TextSplitter textSplitter);

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.springframework.ai.core.loader.impl;
package org.springframework.ai.loader.impl;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.ai.core.document.Document;
import org.springframework.ai.core.loader.Loader;
import org.springframework.ai.core.splitter.TextSplitter;
import org.springframework.ai.core.splitter.TokenTextSplitter;
import org.springframework.ai.document.Document;
import org.springframework.ai.loader.Loader;
import org.springframework.ai.splitter.TextSplitter;
import org.springframework.ai.splitter.TokenTextSplitter;
import org.springframework.core.io.Resource;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.springframework.ai.core.memory;
package org.springframework.ai.memory;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.springframework.ai.core.parser;
package org.springframework.ai.parser;

import org.springframework.ai.core.llm.Generation;
import org.springframework.ai.client.Generation;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

import org.springframework.ai.core.prompt.messages.AssistantMessage;
import org.springframework.ai.prompt.messages.AssistantMessage;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

import org.springframework.ai.core.prompt.messages.Message;
import org.springframework.ai.prompt.messages.Message;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

public class FunctionPromptTemplate extends PromptTemplate {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

import org.springframework.ai.core.llm.Generation;
import org.springframework.ai.client.Generation;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

import java.util.Collections;
import java.util.List;

import org.springframework.ai.core.prompt.messages.UserMessage;
import org.springframework.ai.core.prompt.messages.Message;
import org.springframework.ai.prompt.messages.UserMessage;
import org.springframework.ai.prompt.messages.Message;

public class Prompt {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;
import org.springframework.ai.core.prompt.messages.Message;
import org.springframework.ai.core.prompt.messages.UserMessage;
import org.springframework.ai.prompt.messages.Message;
import org.springframework.ai.prompt.messages.UserMessage;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.compiler.STLexer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

import org.springframework.ai.core.prompt.messages.Message;
import org.springframework.ai.prompt.messages.Message;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

import java.util.Map;

import org.springframework.ai.core.prompt.messages.SystemMessage;
import org.springframework.ai.prompt.messages.SystemMessage;

public class SystemPromptTemplate extends PromptTemplate {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt;
package org.springframework.ai.prompt;

public enum TemplateFormat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt.messages;
package org.springframework.ai.prompt.messages;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt.messages;
package org.springframework.ai.prompt.messages;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt.messages;
package org.springframework.ai.prompt.messages;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt.messages;
package org.springframework.ai.prompt.messages;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt.messages;
package org.springframework.ai.prompt.messages;

import java.util.Map;

public interface Message {

String getContent();

// TODO investigate use of "function_name" and "name" - maybe cna be first class
// representation vs. map.
Map<String, Object> getProperties();

MessageType getMessageType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ai.core.prompt.messages;
package org.springframework.ai.prompt.messages;

public enum MessageType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt.messages;
package org.springframework.ai.prompt.messages;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.ai.core.prompt.messages;
package org.springframework.ai.prompt.messages;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.springframework.ai.core.retriever;
package org.springframework.ai.retriever;

import org.springframework.ai.core.document.Document;
import org.springframework.ai.document.Document;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.springframework.ai.core.retriever.impl;
package org.springframework.ai.retriever.impl;

import org.springframework.ai.core.document.Document;
import org.springframework.ai.core.retriever.Retriever;
import org.springframework.ai.core.vectorstore.VectorStore;
import org.springframework.ai.document.Document;
import org.springframework.ai.retriever.Retriever;
import org.springframework.ai.vectorstore.VectorStore;

import java.util.List;
import java.util.Objects;
Expand Down
Loading

0 comments on commit 2682e0e

Please sign in to comment.