forked from HamaWhiteGG/langchain-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8584f4
commit aaeb8d2
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
langchain-core/src/main/java/com/hw/langchain/llms/ollama/Ollama.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.hw.langchain.llms.ollama; | ||
|
||
|
||
import com.hw.langchain.llms.base.BaseLLM; | ||
import com.hw.langchain.schema.LLMResult; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Ollama locally run large language models. | ||
* | ||
* @author HamaWhite | ||
*/ | ||
@SuperBuilder | ||
public class Ollama extends BaseLLM { | ||
@Override | ||
public String llmType() { | ||
return "ollama-llm"; | ||
} | ||
|
||
/** | ||
* Call out to Ollama's generate endpoint. | ||
* | ||
* @param prompts The prompt to pass into the model. | ||
* @param stop list of stop words to use when generating. | ||
* @return The string generated by the model. | ||
*/ | ||
@Override | ||
protected LLMResult _generate(List<String> prompts, List<String> stop) { | ||
return null; | ||
} | ||
} |