From 3900e0adebd98b43d601b8a02243ee7019efc405 Mon Sep 17 00:00:00 2001 From: Cole Medin Date: Wed, 13 Nov 2024 09:08:59 -0600 Subject: [PATCH] Updating the LLM eval agent to work with Ollama --- llm-agent-evaluation-framework/.env.example | 7 ++++- .../requirements.txt | Bin 441 -> 9274 bytes llm-agent-evaluation-framework/runnable.py | 27 ++++++++++++++---- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/llm-agent-evaluation-framework/.env.example b/llm-agent-evaluation-framework/.env.example index 55e9601..7fbcdf4 100644 --- a/llm-agent-evaluation-framework/.env.example +++ b/llm-agent-evaluation-framework/.env.example @@ -28,7 +28,12 @@ HUGGINGFACEHUB_API_TOKEN= # And all Anthropic models you can use here - # https://docs.anthropic.com/en/docs/about-claude/models # A good default to go with here is gpt-4o-mini, claude-3-5-sonnet-20240620, or llama3-groq-70b-8192-tool-use-preview -LLM_MODEL=gpt-4o-mini +LLM_MODEL= + +# The provider you want to use for your LLMs +# If you don't specify this, the script will try to determine your provider from your model, but this isn't guaranteed to work! +# Possible providers: openai, anthropic, groq, ollama +LLM_PROVIDER= # Get your personal Asana access token through the developer console in Asana. # Feel free to follow these instructions - diff --git a/llm-agent-evaluation-framework/requirements.txt b/llm-agent-evaluation-framework/requirements.txt index 3e9e42c480833e989ccde9eb3ffe55f4f74bfc20..1e1590a472f6be37e30e8ed5bca2126cb7012dfc 100644 GIT binary patch literal 9274 zcmb`NOK)4r5rywMKz<4Xlaw{_B8vfn1Q^T!PG*s0B}f!0$(Bf&q(-)We3J9^xrcT6 zkY@}G3|X?ey1MGrsYf^czyDr#cipPH?Jm1V{rS?(+t-!;eXl>8?l1Z?>HgH6>1*2k zvHOEoykpyKwS)Dk*2dkN{_m36Nb;szHeJY#n+{}$GM{wLopjBcF0@RVt~b5Zz1BE$ z-PYe~9b2MfDgCP^frjgDq@TaYu6b`e`o7awv@NxMD_twe+;y|vnbYpwfz-XE&ZG}i z*t60}Q~i70J?W>dc0cqsV-LH7&r&US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dORcIGq|68}JZ2YA>&zaBlb+ z+;{DC%i02Z7QNC{j9b>j&YG$S)!Ff2-1?5Ql-oF2=1-8>F|>j^B%iSiZ)4`5Pxt4M zXy=oXdXG1se(wGuZhtT9+*==dq{0qf(XEHMc-^q}YeX1))>z?O@+3|5<6W2N1oh!- zJom@_Tb^r@adkB4_3U@tsDt(!TgZ6$N{wZD;9kc~xNbc|S$IN(m}csg%st!Mn87L{ z#x}NOUp~up#v$Wr$uk4`ho7@K|BVT2yuCV4z!mFCzt;{w6Q~o0lHAmJ5dl@-i%Zid zt=J3ld9N=^+hZ->$sLZ3G+VzB=f z;R**XvEW6X)EjqoA+PhAm>U~W=X2P6dg<7KjO)Z}vd5n;8Sk1pU*Cz>!+KuxD4cS% zUfa$8YoH%ez5QYa&kH-}tvQ8XWB_+1W?B&OSw^hRA}jqyrW-sd>#5VQu=wwO z;W#}v-7pkxxi@i!F(F4vB5y0hJg}_g=Iz!&pJTE$Q%bg&|14jwghB2G)bYbl{HTMK zr^h?2cle3YvwWmZR^1uaQQk%PpA2MA>YL;BZ>?;^&wuSOH~)!;CGpOazpIREG<>m! P7x~Kkfo|_Y!ub9lZ8vMt literal 441 zcmY*V%Z|e!47~F%pg^|!IPfK_9$e}I5-|ynmHPK}n@D9ZNFEO}cR!63qtVzXAO`SYm47g)pYsec5-TsNldxhLlMoP9zGYm`TyE=6{? jmb?2f1EaSfGw_?@ Dict[str, AnyMessage]: +def call_model(state: GraphState, config: RunnableConfig) -> Dict[str, AnyMessage]: """ Function that calls the model to generate a response. @@ -88,7 +103,7 @@ async def call_model(state: GraphState, config: RunnableConfig) -> Dict[str, Any )) # Invoke the chatbot with the binded tools - response = await chatbot_with_tools.ainvoke(messages, config) + response = chatbot_with_tools.invoke(messages, config) # print("Response from model:", response) # We return an object because this will get added to the existing list