Skip to content

Commit

Permalink
Update fromLLMAndTools method name HamaWhiteGG#128
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaWhiteGG committed Nov 30, 2023
1 parent baf3114 commit 29ff7a5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public Map<String, Object> getFullInputs(List<Pair<AgentAction, String>> interme
return fullInputs;
}

public static BaseSingleActionAgent fromLlmAndTools(
public static BaseSingleActionAgent fromLLMAndTools(
BaseLanguageModel llm,
List<BaseTool> tools,
Map<String, Object> kwargs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public List<String> returnValues() {
*/
public abstract AgentResult plan(List<Pair<AgentAction, String>> intermediateSteps, Map<String, Object> kwargs);

public static BaseSingleActionAgent fromLlmAndTools(
public static BaseSingleActionAgent fromLLMAndTools(
BaseLanguageModel llm,
List<BaseTool> tools,
Map<String, Object> kwargs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ public static BasePromptTemplate createPrompt(List<BaseTool> tools, String syste
* Construct an agent from an LLM and tools.
* This method will be called by the {@link Initialize#initializeAgent} using MethodUtils.invokeStaticMethod.
*/
public static Agent fromLlmAndTools(BaseLanguageModel llm, List<BaseTool> tools, Map<String, Object> kwargs) {
return fromLlmAndTools(llm, tools, null, SYSTEM_MESSAGE_PREFIX, SYSTEM_MESSAGE_SUFFIX, HUMAN_MESSAGE,
public static Agent fromLLMAndTools(BaseLanguageModel llm, List<BaseTool> tools, Map<String, Object> kwargs) {
return fromLLMAndTools(llm, tools, null, SYSTEM_MESSAGE_PREFIX, SYSTEM_MESSAGE_SUFFIX, HUMAN_MESSAGE,
FORMAT_INSTRUCTIONS, null, kwargs);
}

/**
* Construct an agent from an LLM and tools.
*/
public static Agent fromLlmAndTools(BaseLanguageModel llm, List<BaseTool> tools, AgentOutputParser outputParser,
public static Agent fromLLMAndTools(BaseLanguageModel llm, List<BaseTool> tools, AgentOutputParser outputParser,
String systemMessagePrefix, String systemMessageSuffix, String humanMessage, String formatInstructions,
List<String> inputVariables, Map<String, Object> kwargs) {
validateTools(tools);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static AgentExecutor initializeAgent(List<BaseTool> tools, BaseLanguageMo
}
Class<? extends BaseSingleActionAgent> clazz = AGENT_TO_CLASS.get(agent);
agentKwargs = agentKwargs != null ? agentKwargs : Map.of();
agentObj = (BaseSingleActionAgent) MethodUtils.invokeStaticMethod(clazz, "fromLlmAndTools",
agentObj = (BaseSingleActionAgent) MethodUtils.invokeStaticMethod(clazz, "fromLLMAndTools",
llm, tools, agentKwargs);
} else if (agentPath != null) {
agentObj = loadAgent(agentPath, Map.of("llm", llm, "tools", tools));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public static PromptTemplate createPrompt(List<BaseTool> tools, String prefix, S
/**
* Construct an agent from an LLM and tools.
*/
public static Agent fromLlmAndTools(BaseLanguageModel llm, List<BaseTool> tools, Map<String, Object> kwargs) {
return fromLlmAndTools(llm, tools, null, PREFIX, SUFFIX, FORMAT_INSTRUCTIONS, null, kwargs);
public static Agent fromLLMAndTools(BaseLanguageModel llm, List<BaseTool> tools, Map<String, Object> kwargs) {
return fromLLMAndTools(llm, tools, null, PREFIX, SUFFIX, FORMAT_INSTRUCTIONS, null, kwargs);
}

/**
* Construct an agent from an LLM and tools.
*/
public static Agent fromLlmAndTools(BaseLanguageModel llm, List<BaseTool> tools, AgentOutputParser outputParser,
public static Agent fromLLMAndTools(BaseLanguageModel llm, List<BaseTool> tools, AgentOutputParser outputParser,
String prefix, String suffix, String formatInstructions, List<String> inputVariables,
Map<String, Object> kwargs) {
validateTools(tools);
Expand Down

0 comments on commit 29ff7a5

Please sign in to comment.