isayahc commited on
Commit
b5b988a
1 Parent(s): 9621297

refactored some code

Browse files
Files changed (1) hide show
  1. mixtral_agent.py +16 -2
mixtral_agent.py CHANGED
@@ -13,12 +13,21 @@ from langchain.agents.output_parsers import (
13
  ReActJsonSingleInputOutputParser,
14
  )
15
  from langchain.tools.render import render_text_description
 
 
 
 
 
 
 
 
 
16
 
17
  # supports many more optional parameters. Hover on your `ChatOllama(...)`
18
  # class to view the latest available supported parameters
19
  llm = ChatOllama(
20
  model="mistral",
21
- base_url="https://0013-35-201-206-176.ngrok-free.app"
22
  )
23
  prompt = ChatPromptTemplate.from_template("Tell me a short joke about {topic}")
24
 
@@ -72,7 +81,12 @@ agent = (
72
  )
73
 
74
  # instantiate AgentExecutor
75
- agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True,handle_parsing_errors=True)
 
 
 
 
 
76
 
77
  # agent_executor.invoke(
78
  # {
 
13
  ReActJsonSingleInputOutputParser,
14
  )
15
  from langchain.tools.render import render_text_description
16
+ import os
17
+
18
+ import dotenv
19
+
20
+ dotenv.load_dotenv()
21
+
22
+
23
+ OLLMA_BASE_URL = os.getenv("OLLMA_BASE_URL")
24
+
25
 
26
  # supports many more optional parameters. Hover on your `ChatOllama(...)`
27
  # class to view the latest available supported parameters
28
  llm = ChatOllama(
29
  model="mistral",
30
+ base_url= OLLMA_BASE_URL
31
  )
32
  prompt = ChatPromptTemplate.from_template("Tell me a short joke about {topic}")
33
 
 
81
  )
82
 
83
  # instantiate AgentExecutor
84
+ agent_executor = AgentExecutor(
85
+ agent=agent,
86
+ tools=tools,
87
+ verbose=True,
88
+ handle_parsing_errors=True
89
+ )
90
 
91
  # agent_executor.invoke(
92
  # {