Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Updating MakeFile and fixing monologue memory parameter issue (#692)

Vincenta0928ae590d8
diff --git a/Makefile b/Makefile
index 9b2942f34c..958ee8bdac 100644
--- a/Makefile
+++ b/Makefile
@@ -60,6 +60,21 @@ setup-config:
@read -p "Enter your LLM API key: " llm_api_key; \
echo "LLM_API_KEY=\"$$llm_api_key\"" >> $(CONFIG_FILE).tmp
+ @echo "Enter your LLM Embedding Model\nChoices are openai, azureopenai, llama2 or leave blank to default to 'BAAI/bge-small-en-v1.5' via huggingface"; \
+ read -p "> " llm_embedding_model; \
+ echo "LLM_EMBEDDING_MODEL=\"$$llm_embedding_model\"" >> $(CONFIG_FILE).tmp; \
+ if [ "$$llm_embedding_model" = "llama2" ]; then \
+ read -p "Enter the local model URL: " llm_base_url; \
+ echo "LLM_BASE_URL=\"$$llm_base_url\"" >> $(CONFIG_FILE).tmp; \
+ elif [ "$$llm_embedding_model" = "azureopenai" ]; then \
+ read -p "Enter the Azure endpoint URL: " llm_base_url; \
+ echo "LLM_BASE_URL=\"$$llm_base_url\"" >> $(CONFIG_FILE).tmp; \
+ read -p "Enter the Azure LLM Deployment Name: " llm_deployment_name; \
+ echo "LLM_DEPLOYMENT_NAME=\"$$llm_deployment_name\"" >> $(CONFIG_FILE).tmp; \
+ read -p "Enter the Azure API Version: " llm_api_version; \
+ echo "LLM_API_VERSION=\"$$llm_api_version\"" >> $(CONFIG_FILE).tmp; \
+ fi
+
@read -p "Enter your workspace directory [default: $(DEFAULT_WORKSPACE_DIR)]: " workspace_dir; \
workspace_dir=$${workspace_dir:-$(DEFAULT_WORKSPACE_DIR)}; \
echo "WORKSPACE_DIR=\"$$workspace_dir\"" >> $(CONFIG_FILE).tmp
diff --git a/agenthub/monologue_agent/utils/memory.py b/agenthub/monologue_agent/utils/memory.py
index e2c2f28f58..50e76946d4 100644
--- a/agenthub/monologue_agent/utils/memory.py
+++ b/agenthub/monologue_agent/utils/memory.py
@@ -21,7 +21,7 @@ if embedding_strategy == "llama2":
elif embedding_strategy == "openai":
from llama_index.embeddings.openai import OpenAIEmbedding
embed_model = OpenAIEmbedding(
- base_url=config.get_or_error("LLM_BASE_URL"),
+ model="text-embedding-ada-002"
)
elif embedding_strategy == "azureopenai":
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding # Need to instruct to set these env variables in documentation