From 21d3dcf6b7ef7ec7b0a7774ac6dbfc6bbd85b86b Mon Sep 17 00:00:00 2001 From: Josh Reini <60949774+joshreini1@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:04:47 -0500 Subject: [PATCH] Releases/rc trulens eval 0.18.3 (#652) * bump version * version bump --- .../models/anthropic_quickstart.ipynb | 2 +- .../expositional/models/azure_openai.ipynb | 2 +- .../expositional/models/bedrock.ipynb | 2 +- .../bedrock_finetuning_experiments.ipynb | 2 +- .../models/google_vertex_quickstart.ipynb | 2 +- .../models/litellm_quickstart.ipynb | 2 +- .../quickstart/groundtruth_evals.ipynb | 2 +- .../examples/quickstart/human_feedback.ipynb | 2 +- .../quickstart/langchain_quickstart.ipynb | 2 +- .../quickstart/llama_index_quickstart.ipynb | 2 +- .../examples/quickstart/prototype_evals.ipynb | 2 +- .../py_script_quickstarts/all_tools.py | 76 +++++-------------- .../langchain_quickstart.py | 13 +--- .../llama_index_quickstart.py | 7 +- .../py_script_quickstarts/quickstart.py | 28 ++----- .../text2text_quickstart.py | 11 +-- .../examples/quickstart/quickstart.ipynb | 2 +- .../quickstart/text2text_quickstart.ipynb | 2 +- trulens_eval/generated_files/all_tools.ipynb | 30 +++----- trulens_eval/trulens_eval/__init__.py | 2 +- 20 files changed, 60 insertions(+), 133 deletions(-) diff --git a/trulens_eval/examples/expositional/models/anthropic_quickstart.ipynb b/trulens_eval/examples/expositional/models/anthropic_quickstart.ipynb index 11184d954..2af1714d5 100644 --- a/trulens_eval/examples/expositional/models/anthropic_quickstart.ipynb +++ b/trulens_eval/examples/expositional/models/anthropic_quickstart.ipynb @@ -18,7 +18,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install anthropic trulens_eval==0.17.0 langchain==0.0.323" + "# ! pip install anthropic trulens_eval==0.18.3 langchain==0.0.347" ] }, { diff --git a/trulens_eval/examples/expositional/models/azure_openai.ipynb b/trulens_eval/examples/expositional/models/azure_openai.ipynb index 42bb7f9b2..efdfa2a5d 100644 --- a/trulens_eval/examples/expositional/models/azure_openai.ipynb +++ b/trulens_eval/examples/expositional/models/azure_openai.ipynb @@ -29,7 +29,7 @@ "metadata": {}, "outputs": [], "source": [ - "#! pip install trulens-eval==0.18.2 llama_index==0.9.13 langchain==0.0.346 html2text==2020.1.16" + "#! pip install trulens-eval==0.18.3 llama_index==0.9.13 langchain==0.0.346 html2text==2020.1.16" ] }, { diff --git a/trulens_eval/examples/expositional/models/bedrock.ipynb b/trulens_eval/examples/expositional/models/bedrock.ipynb index 0e6ab5ef3..ece215432 100644 --- a/trulens_eval/examples/expositional/models/bedrock.ipynb +++ b/trulens_eval/examples/expositional/models/bedrock.ipynb @@ -35,7 +35,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 langchain==0.0.305 boto3==1.28.59" + "# ! pip install trulens_eval==0.18.3 langchain==0.0.305 boto3==1.28.59" ] }, { diff --git a/trulens_eval/examples/expositional/models/bedrock_finetuning_experiments.ipynb b/trulens_eval/examples/expositional/models/bedrock_finetuning_experiments.ipynb index f5019c5aa..1e3420005 100644 --- a/trulens_eval/examples/expositional/models/bedrock_finetuning_experiments.ipynb +++ b/trulens_eval/examples/expositional/models/bedrock_finetuning_experiments.ipynb @@ -55,7 +55,7 @@ }, "outputs": [], "source": [ - "# ! pip install --upgrade sagemaker datasets boto3 trulens_eval" + "# ! pip install trulens_eval==0.18.3 sagemaker datasets boto3 " ] }, { diff --git a/trulens_eval/examples/expositional/models/google_vertex_quickstart.ipynb b/trulens_eval/examples/expositional/models/google_vertex_quickstart.ipynb index 12b6d889d..0efd86090 100644 --- a/trulens_eval/examples/expositional/models/google_vertex_quickstart.ipynb +++ b/trulens_eval/examples/expositional/models/google_vertex_quickstart.ipynb @@ -18,7 +18,7 @@ "metadata": {}, "outputs": [], "source": [ - "#! pip install google-cloud-aiplatform==1.36.3 litellm==0.14.1 trulens_eval==0.17.0 langchain==0.0.323" + "#! pip install google-cloud-aiplatform==1.36.3 litellm==1.11.1 trulens_eval==0.18.3 langchain==0.0.347" ] }, { diff --git a/trulens_eval/examples/expositional/models/litellm_quickstart.ipynb b/trulens_eval/examples/expositional/models/litellm_quickstart.ipynb index 390438704..4f7547aae 100644 --- a/trulens_eval/examples/expositional/models/litellm_quickstart.ipynb +++ b/trulens_eval/examples/expositional/models/litellm_quickstart.ipynb @@ -20,7 +20,7 @@ "metadata": {}, "outputs": [], "source": [ - "#! pip install openai==0.28.1 litellm==0.14.1 trulens_eval==0.17.0 langchain==0.0.323" + "#! pip install openai==1.3.7 litellm==1.11.1 trulens_eval==0.18.3 langchain==0.0.347" ] }, { diff --git a/trulens_eval/examples/quickstart/groundtruth_evals.ipynb b/trulens_eval/examples/quickstart/groundtruth_evals.ipynb index f4ec4d0af..fa488be34 100644 --- a/trulens_eval/examples/quickstart/groundtruth_evals.ipynb +++ b/trulens_eval/examples/quickstart/groundtruth_evals.ipynb @@ -29,7 +29,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 openai==1.3.1" + "# ! pip install trulens_eval==0.18.3 openai==1.3.7" ] }, { diff --git a/trulens_eval/examples/quickstart/human_feedback.ipynb b/trulens_eval/examples/quickstart/human_feedback.ipynb index fd61e1ff1..4e550c793 100644 --- a/trulens_eval/examples/quickstart/human_feedback.ipynb +++ b/trulens_eval/examples/quickstart/human_feedback.ipynb @@ -17,7 +17,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 openai==1.3.1" + "# ! pip install trulens_eval==0.18.3 openai==1.3.7" ] }, { diff --git a/trulens_eval/examples/quickstart/langchain_quickstart.ipynb b/trulens_eval/examples/quickstart/langchain_quickstart.ipynb index 2771442e1..ae2aa6ad9 100644 --- a/trulens_eval/examples/quickstart/langchain_quickstart.ipynb +++ b/trulens_eval/examples/quickstart/langchain_quickstart.ipynb @@ -28,7 +28,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 openai==1.3.1" + "# ! pip install trulens_eval==0.18.3 openai==1.3.7" ] }, { diff --git a/trulens_eval/examples/quickstart/llama_index_quickstart.ipynb b/trulens_eval/examples/quickstart/llama_index_quickstart.ipynb index 64b6e6345..0be445ca9 100644 --- a/trulens_eval/examples/quickstart/llama_index_quickstart.ipynb +++ b/trulens_eval/examples/quickstart/llama_index_quickstart.ipynb @@ -31,7 +31,7 @@ "metadata": {}, "outputs": [], "source": [ - "# pip install trulens_eval==0.18.2 llama_index>=0.8.69 html2text>=2020.1.16 " + "# pip install trulens_eval==0.18.3 llama_index>=0.8.69 html2text>=2020.1.16 " ] }, { diff --git a/trulens_eval/examples/quickstart/prototype_evals.ipynb b/trulens_eval/examples/quickstart/prototype_evals.ipynb index 10a1033b3..9715d5167 100644 --- a/trulens_eval/examples/quickstart/prototype_evals.ipynb +++ b/trulens_eval/examples/quickstart/prototype_evals.ipynb @@ -28,7 +28,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2" + "# ! pip install trulens_eval==0.18.3" ] }, { diff --git a/trulens_eval/examples/quickstart/py_script_quickstarts/all_tools.py b/trulens_eval/examples/quickstart/py_script_quickstarts/all_tools.py index fede1e2ac..50b0bfbb2 100644 --- a/trulens_eval/examples/quickstart/py_script_quickstarts/all_tools.py +++ b/trulens_eval/examples/quickstart/py_script_quickstarts/all_tools.py @@ -14,14 +14,13 @@ # In[ ]: -# ! pip install trulens_eval==0.18.2 openai==1.3.1 +# ! pip install trulens_eval==0.18.3 openai==1.3.7 # In[ ]: import os - os.environ["OPENAI_API_KEY"] = "..." os.environ["HUGGINGFACE_API_KEY"] = "..." @@ -34,12 +33,8 @@ from IPython.display import JSON # Imports main tools: -from trulens_eval import Feedback -from trulens_eval import Huggingface -from trulens_eval import Tru -from trulens_eval import TruChain +from trulens_eval import TruChain, Feedback, Huggingface, Tru from trulens_eval.schema import FeedbackResult - tru = Tru() # Imports from langchain to build app. You may need to install langchain first @@ -47,9 +42,9 @@ # ! pip install langchain>=0.0.170 from langchain.chains import LLMChain from langchain.llms import OpenAI -from langchain.prompts import ChatPromptTemplate +from langchain.prompts import ChatPromptTemplate, PromptTemplate from langchain.prompts import HumanMessagePromptTemplate -from langchain.prompts import PromptTemplate + # ### Create Simple LLM Application # @@ -191,7 +186,7 @@ # In[ ]: -# pip install trulens_eval==0.18.2 llama_index>=0.8.69 html2text>=2020.1.16 +# pip install trulens_eval==0.18.3 llama_index>=0.8.69 html2text>=2020.1.16 # ### Add API keys @@ -201,7 +196,6 @@ import os - os.environ["OPENAI_API_KEY"] = "..." @@ -210,9 +204,7 @@ # In[ ]: -from trulens_eval import Feedback -from trulens_eval import Tru -from trulens_eval import TruLlama +from trulens_eval import Feedback, Tru, TruLlama from trulens_eval.feedback import Groundedness from trulens_eval.feedback.provider.openai import OpenAI @@ -324,25 +316,16 @@ # In[ ]: -# ! pip install trulens_eval==0.18.2 chromadb==0.4.18 openai==1.3.1 +# ! pip install trulens_eval==0.18.3 chromadb==0.4.18 openai==1.3.7 # In[ ]: import os - os.environ["OPENAI_API_KEY"] = "sk-..." -# In[ ]: - - -from openai import OpenAI - -oai_client = OpenAI() - - # ## Get Data # # In this case, we'll just initialize some simple text in the notebook. @@ -366,6 +349,9 @@ # In[ ]: +from openai import OpenAI +oai_client = OpenAI() + oai_client.embeddings.create( model="text-embedding-ada-002", input=university_info @@ -377,15 +363,12 @@ import chromadb from chromadb.utils.embedding_functions import OpenAIEmbeddingFunction -from openai import OpenAI - -oai_client = OpenAI() embedding_function = OpenAIEmbeddingFunction(api_key=os.environ.get('OPENAI_API_KEY'), model_name="text-embedding-ada-002") -chroma_client = chromadb.PersistentClient(path="./chromadb") +chroma_client = chromadb.Client() vector_store = chroma_client.get_or_create_collection(name="Universities", embedding_function=embedding_function) @@ -407,7 +390,6 @@ from trulens_eval import Tru from trulens_eval.tru_custom_app import instrument - tru = Tru() @@ -464,13 +446,12 @@ def query(self, query: str) -> str: # In[ ]: -import numpy as np - -from trulens_eval import Feedback -from trulens_eval import Select +from trulens_eval import Feedback, Select from trulens_eval.feedback import Groundedness from trulens_eval.feedback.provider.openai import OpenAI as fOpenAI +import numpy as np + # Initialize provider class fopenai = fOpenAI() @@ -507,7 +488,6 @@ def query(self, query: str) -> str: from trulens_eval import TruCustomApp - tru_rag = TruCustomApp(rag, app_id = 'RAG v1', feedbacks = [f_groundedness, f_qa_relevance, f_context_relevance]) @@ -549,7 +529,7 @@ def query(self, query: str) -> str: # In[ ]: -# ! pip install trulens_eval==0.18.2 +# ! pip install trulens_eval==0.18.3 # In[ ]: @@ -569,7 +549,6 @@ def query(self, query: str) -> str: import os - os.environ["OPENAI_API_KEY"] = "..." @@ -579,12 +558,10 @@ def query(self, query: str) -> str: from openai import OpenAI - oai_client = OpenAI() from trulens_eval.tru_custom_app import instrument - class APP: @instrument def completion(self, prompt): @@ -626,7 +603,6 @@ def completion(self, prompt): # add trulens as a context manager for llm_app with dummy feedback from trulens_eval import TruCustomApp - tru_app = TruCustomApp(llm_app, app_id = 'LLM App v1', feedbacks = [f_positive_sentiment]) @@ -656,7 +632,7 @@ def completion(self, prompt): # In[ ]: -# ! pip install trulens_eval==0.18.2 openai==1.3.1 +# ! pip install trulens_eval==0.18.3 openai==1.3.7 # In[ ]: @@ -690,12 +666,10 @@ def completion(self, prompt): from openai import OpenAI - oai_client = OpenAI() from trulens_eval.tru_custom_app import instrument - class APP: @instrument def completion(self, prompt): @@ -716,7 +690,6 @@ def completion(self, prompt): # add trulens as a context manager for llm_app from trulens_eval import TruCustomApp - tru_app = TruCustomApp(llm_app, app_id = 'LLM App v1') @@ -745,9 +718,7 @@ def completion(self, prompt): # In[ ]: -from ipywidgets import Button -from ipywidgets import HBox -from ipywidgets import VBox +from ipywidgets import Button, HBox, VBox thumbs_up_button = Button(description='👍') thumbs_down_button = Button(description='👎') @@ -802,14 +773,13 @@ def on_thumbs_down_button_clicked(b): # In[ ]: -# ! pip install trulens_eval==0.18.2 openai==1.3.1 +# ! pip install trulens_eval==0.18.3 openai==1.3.7 # In[2]: import os - os.environ["OPENAI_API_KEY"] = "..." @@ -827,12 +797,10 @@ def on_thumbs_down_button_clicked(b): from openai import OpenAI - oai_client = OpenAI() from trulens_eval.tru_custom_app import instrument - class APP: @instrument def completion(self, prompt): @@ -875,7 +843,6 @@ def completion(self, prompt): # add trulens as a context manager for llm_app from trulens_eval import TruCustomApp - tru_app = TruCustomApp(llm_app, app_id = 'LLM App v1', feedbacks = [f_groundtruth]) @@ -1040,11 +1007,7 @@ def completion(self, prompt): # In[ ]: -from trulens_eval import Feedback -from trulens_eval import Provider -from trulens_eval import Select -from trulens_eval import Tru - +from trulens_eval import Provider, Feedback, Select, Tru class StandAlone(Provider): def custom_feedback(self, my_text_field: str) -> float: @@ -1105,7 +1068,6 @@ def custom_feedback(self, my_text_field: str) -> float: # Aggregators will run on the same dict keys. import numpy as np - multi_output_feedback = Feedback(lambda input_param: {'output_key1': 0.1, 'output_key2': 0.9}, name="multi-agg").on( input_param=Select.RecordOutput ).aggregate(np.mean) diff --git a/trulens_eval/examples/quickstart/py_script_quickstarts/langchain_quickstart.py b/trulens_eval/examples/quickstart/py_script_quickstarts/langchain_quickstart.py index 30c5ac20a..c05aab2cc 100644 --- a/trulens_eval/examples/quickstart/py_script_quickstarts/langchain_quickstart.py +++ b/trulens_eval/examples/quickstart/py_script_quickstarts/langchain_quickstart.py @@ -14,14 +14,13 @@ # In[ ]: -# ! pip install trulens_eval==0.18.2 openai==1.3.1 +# ! pip install trulens_eval==0.18.3 openai==1.3.7 # In[ ]: import os - os.environ["OPENAI_API_KEY"] = "..." os.environ["HUGGINGFACE_API_KEY"] = "..." @@ -34,12 +33,8 @@ from IPython.display import JSON # Imports main tools: -from trulens_eval import Feedback -from trulens_eval import Huggingface -from trulens_eval import Tru -from trulens_eval import TruChain +from trulens_eval import TruChain, Feedback, Huggingface, Tru from trulens_eval.schema import FeedbackResult - tru = Tru() # Imports from langchain to build app. You may need to install langchain first @@ -47,9 +42,9 @@ # ! pip install langchain>=0.0.170 from langchain.chains import LLMChain from langchain.llms import OpenAI -from langchain.prompts import ChatPromptTemplate +from langchain.prompts import ChatPromptTemplate, PromptTemplate from langchain.prompts import HumanMessagePromptTemplate -from langchain.prompts import PromptTemplate + # ### Create Simple LLM Application # diff --git a/trulens_eval/examples/quickstart/py_script_quickstarts/llama_index_quickstart.py b/trulens_eval/examples/quickstart/py_script_quickstarts/llama_index_quickstart.py index a7aebb86f..d27b9e39b 100644 --- a/trulens_eval/examples/quickstart/py_script_quickstarts/llama_index_quickstart.py +++ b/trulens_eval/examples/quickstart/py_script_quickstarts/llama_index_quickstart.py @@ -17,7 +17,7 @@ # In[ ]: -# pip install trulens_eval==0.18.2 llama_index>=0.8.69 html2text>=2020.1.16 +# pip install trulens_eval==0.18.3 llama_index>=0.8.69 html2text>=2020.1.16 # ### Add API keys @@ -27,7 +27,6 @@ import os - os.environ["OPENAI_API_KEY"] = "..." @@ -36,9 +35,7 @@ # In[ ]: -from trulens_eval import Feedback -from trulens_eval import Tru -from trulens_eval import TruLlama +from trulens_eval import Feedback, Tru, TruLlama from trulens_eval.feedback import Groundedness from trulens_eval.feedback.provider.openai import OpenAI diff --git a/trulens_eval/examples/quickstart/py_script_quickstarts/quickstart.py b/trulens_eval/examples/quickstart/py_script_quickstarts/quickstart.py index 9140026c9..30b3d52dd 100644 --- a/trulens_eval/examples/quickstart/py_script_quickstarts/quickstart.py +++ b/trulens_eval/examples/quickstart/py_script_quickstarts/quickstart.py @@ -12,25 +12,16 @@ # In[ ]: -# ! pip install trulens_eval==0.18.2 chromadb==0.4.18 openai==1.3.1 +# ! pip install trulens_eval==0.18.3 chromadb==0.4.18 openai==1.3.7 # In[ ]: import os - os.environ["OPENAI_API_KEY"] = "sk-..." -# In[ ]: - - -from openai import OpenAI - -oai_client = OpenAI() - - # ## Get Data # # In this case, we'll just initialize some simple text in the notebook. @@ -54,6 +45,9 @@ # In[ ]: +from openai import OpenAI +oai_client = OpenAI() + oai_client.embeddings.create( model="text-embedding-ada-002", input=university_info @@ -65,15 +59,12 @@ import chromadb from chromadb.utils.embedding_functions import OpenAIEmbeddingFunction -from openai import OpenAI - -oai_client = OpenAI() embedding_function = OpenAIEmbeddingFunction(api_key=os.environ.get('OPENAI_API_KEY'), model_name="text-embedding-ada-002") -chroma_client = chromadb.PersistentClient(path="./chromadb") +chroma_client = chromadb.Client() vector_store = chroma_client.get_or_create_collection(name="Universities", embedding_function=embedding_function) @@ -95,7 +86,6 @@ from trulens_eval import Tru from trulens_eval.tru_custom_app import instrument - tru = Tru() @@ -152,13 +142,12 @@ def query(self, query: str) -> str: # In[ ]: -import numpy as np - -from trulens_eval import Feedback -from trulens_eval import Select +from trulens_eval import Feedback, Select from trulens_eval.feedback import Groundedness from trulens_eval.feedback.provider.openai import OpenAI as fOpenAI +import numpy as np + # Initialize provider class fopenai = fOpenAI() @@ -195,7 +184,6 @@ def query(self, query: str) -> str: from trulens_eval import TruCustomApp - tru_rag = TruCustomApp(rag, app_id = 'RAG v1', feedbacks = [f_groundedness, f_qa_relevance, f_context_relevance]) diff --git a/trulens_eval/examples/quickstart/py_script_quickstarts/text2text_quickstart.py b/trulens_eval/examples/quickstart/py_script_quickstarts/text2text_quickstart.py index 638aa8312..7d11d4b0a 100644 --- a/trulens_eval/examples/quickstart/py_script_quickstarts/text2text_quickstart.py +++ b/trulens_eval/examples/quickstart/py_script_quickstarts/text2text_quickstart.py @@ -14,14 +14,13 @@ # In[ ]: -# ! pip install trulens_eval==0.18.2 openai==1.3.1 +# ! pip install trulens_eval==0.18.3 openai==1.3.1 # In[ ]: import os - os.environ["OPENAI_API_KEY"] = "..." @@ -31,16 +30,13 @@ from IPython.display import JSON + # Create openai client from openai import OpenAI - client = OpenAI() # Imports main tools: -from trulens_eval import Feedback -from trulens_eval import OpenAI as fOpenAI -from trulens_eval import Tru - +from trulens_eval import Feedback, OpenAI as fOpenAI, Tru tru = Tru() tru.reset_database() @@ -90,7 +86,6 @@ def llm_standalone(prompt): from trulens_eval import TruBasicApp - tru_llm_standalone_recorder = TruBasicApp(llm_standalone, app_id="Happy Bot", feedbacks=[f_relevance]) diff --git a/trulens_eval/examples/quickstart/quickstart.ipynb b/trulens_eval/examples/quickstart/quickstart.ipynb index 22bd2c4d4..ff3ee7548 100644 --- a/trulens_eval/examples/quickstart/quickstart.ipynb +++ b/trulens_eval/examples/quickstart/quickstart.ipynb @@ -19,7 +19,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 chromadb==0.4.18 openai==1.3.7" + "# ! pip install trulens_eval==0.18.3 chromadb==0.4.18 openai==1.3.7" ] }, { diff --git a/trulens_eval/examples/quickstart/text2text_quickstart.ipynb b/trulens_eval/examples/quickstart/text2text_quickstart.ipynb index bf5a46649..6eed6c48c 100644 --- a/trulens_eval/examples/quickstart/text2text_quickstart.ipynb +++ b/trulens_eval/examples/quickstart/text2text_quickstart.ipynb @@ -28,7 +28,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 openai==1.3.1" + "# ! pip install trulens_eval==0.18.3 openai==1.3.1" ] }, { diff --git a/trulens_eval/generated_files/all_tools.ipynb b/trulens_eval/generated_files/all_tools.ipynb index 59f6e253a..f8443c8c8 100644 --- a/trulens_eval/generated_files/all_tools.ipynb +++ b/trulens_eval/generated_files/all_tools.ipynb @@ -28,7 +28,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 openai==1.3.1" + "# ! pip install trulens_eval==0.18.3 openai==1.3.7" ] }, { @@ -310,7 +310,7 @@ "metadata": {}, "outputs": [], "source": [ - "# pip install trulens_eval==0.18.2 llama_index>=0.8.69 html2text>=2020.1.16 " + "# pip install trulens_eval==0.18.3 llama_index>=0.8.69 html2text>=2020.1.16 " ] }, { @@ -535,7 +535,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 chromadb==0.4.18 openai==1.3.1" + "# ! pip install trulens_eval==0.18.3 chromadb==0.4.18 openai==1.3.7" ] }, { @@ -548,17 +548,6 @@ "os.environ[\"OPENAI_API_KEY\"] = \"sk-...\"" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from openai import OpenAI\n", - "\n", - "oai_client = OpenAI()" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -598,6 +587,9 @@ "metadata": {}, "outputs": [], "source": [ + "from openai import OpenAI\n", + "oai_client = OpenAI()\n", + "\n", "oai_client.embeddings.create(\n", " model=\"text-embedding-ada-002\",\n", " input=university_info\n", @@ -612,14 +604,12 @@ "source": [ "import chromadb\n", "from chromadb.utils.embedding_functions import OpenAIEmbeddingFunction\n", - "from openai import OpenAI\n", - "oai_client = OpenAI()\n", "\n", "embedding_function = OpenAIEmbeddingFunction(api_key=os.environ.get('OPENAI_API_KEY'),\n", " model_name=\"text-embedding-ada-002\")\n", "\n", "\n", - "chroma_client = chromadb.PersistentClient(path=\"./chromadb\")\n", + "chroma_client = chromadb.Client()\n", "vector_store = chroma_client.get_or_create_collection(name=\"Universities\",\n", " embedding_function=embedding_function)" ] @@ -847,7 +837,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2" + "# ! pip install trulens_eval==0.18.3" ] }, { @@ -1004,7 +994,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 openai==1.3.1" + "# ! pip install trulens_eval==0.18.3 openai==1.3.7" ] }, { @@ -1214,7 +1204,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! pip install trulens_eval==0.18.2 openai==1.3.1" + "# ! pip install trulens_eval==0.18.3 openai==1.3.7" ] }, { diff --git a/trulens_eval/trulens_eval/__init__.py b/trulens_eval/trulens_eval/__init__.py index ca6442918..be59e905b 100644 --- a/trulens_eval/trulens_eval/__init__.py +++ b/trulens_eval/trulens_eval/__init__.py @@ -78,7 +78,7 @@ """ -__version__ = "0.18.2" +__version__ = "0.18.3" from trulens_eval.feedback import Bedrock from trulens_eval.feedback import Feedback