skrawcz commented on code in PR #1523:
URL: https://github.com/apache/hamilton/pull/1523#discussion_r3005275371


##########
contrib/hamilton/contrib/dagworks/conversational_rag/__init__.py:
##########
@@ -112,13 +130,31 @@ def answer_prompt(context: str, standalone_question: str) 
-> str:
     return template.format(context=context, question=standalone_question)
 
 
-def llm_client() -> openai.OpenAI:
-    """The LLM client to use for the RAG model."""
[email protected]_not(provider="minimax")
+def llm_client__openai() -> openai.OpenAI:
+    """The OpenAI LLM client (default).
+
+    Uses the OPENAI_API_KEY environment variable for authentication.
+    """
     return openai.OpenAI()
 
 
-def conversational_rag_response(answer_prompt: str, llm_client: openai.OpenAI) 
-> str:
-    """Creates the RAG response from the LLM model for the given prompt.
[email protected](provider="minimax")
+def llm_client__minimax() -> openai.OpenAI:
+    """The MiniMax LLM client via OpenAI-compatible API.
+
+    Uses the MINIMAX_API_KEY environment variable for authentication.
+    MiniMax provides an OpenAI-compatible endpoint at 
https://api.minimax.io/v1.
+    """
+    return openai.OpenAI(
+        base_url="https://api.minimax.io/v1";,
+        api_key=os.environ.get("MINIMAX_API_KEY"),
+    )
+
+
[email protected]_not(provider="minimax")
+def conversational_rag_response__openai(answer_prompt: str, llm_client: 
openai.OpenAI) -> str:

Review Comment:
   we can simplify the code here to make it DRYer. If we raise `model` to be an 
input then this function doesn't need to be touched.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to