building of pipeline (validation flaky)
This commit is contained in:
16
libs/runnables.py
Normal file
16
libs/runnables.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from langchain_ollama.chat_models import ChatOllama
|
||||
from langchain_core.messages import SystemMessage, HumanMessage
|
||||
from libs.test_class import Test
|
||||
|
||||
def basic(model: str, seed: int, test: Test, base_url: str) -> str:
|
||||
|
||||
if test.system_msg == None: prompt = [ test.human_msg ]
|
||||
else: prompt = [ test.system_msg, test.human_msg ]
|
||||
|
||||
llm = ChatOllama(
|
||||
model=model,
|
||||
seed=seed,
|
||||
base_url=base_url
|
||||
)
|
||||
ai_msg = llm.invoke(prompt)
|
||||
return ai_msg.content
|
||||
Reference in New Issue
Block a user