Notebook
In [ ]:
Copied!
# Install fixes to crewai and crewai_tools:
# ! pip uninstall -y crewai crewai_tools
# ! pip install git+https://github.com/piotrm0/crewAI@piotrm/wraps
# ! pip install git+https://github.com/piotrm0/crewAI-tools@piotrm/base_tool
# ! pip list | grep crew
# Install fixes to crewai and crewai_tools:
# ! pip uninstall -y crewai crewai_tools
# ! pip install git+https://github.com/piotrm0/crewAI@piotrm/wraps
# ! pip install git+https://github.com/piotrm0/crewAI-tools@piotrm/base_tool
# ! pip list | grep crew
In [ ]:
Copied!
from pathlib import Path
import sys
sys.path.append(str(Path.cwd().parent))
from dotenv import load_dotenv
load_dotenv()
# If you have these in your env, they seem to be picked up by litellm for
# requests which should not use them and thus cause problems.
import os
del os.environ['AWS_ACCESS_KEY_ID']
del os.environ['AWS_SECRET_ACCESS_KEY']
from pathlib import Path
import sys
sys.path.append(str(Path.cwd().parent))
from dotenv import load_dotenv
load_dotenv()
# If you have these in your env, they seem to be picked up by litellm for
# requests which should not use them and thus cause problems.
import os
del os.environ['AWS_ACCESS_KEY_ID']
del os.environ['AWS_SECRET_ACCESS_KEY']
In [ ]:
Copied!
import trulens.core.utils.threading # to patch Thread and ThreadPoolExecutor
from trulens.core.session import TruSession
from trulens.apps.custom import TruCustomApp
session = TruSession()
session.experimental_enable_feature("otel_tracing")
session.reset_database()
session.start_dashboard(force=True, port=8080)
import trulens.core.utils.threading # to patch Thread and ThreadPoolExecutor
from trulens.core.session import TruSession
from trulens.apps.custom import TruCustomApp
session = TruSession()
session.experimental_enable_feature("otel_tracing")
session.reset_database()
session.start_dashboard(force=True, port=8080)
In [ ]:
Copied!
from surprise_travel.crew import SurpriseTravelCrew
surprise_travel_crew = SurpriseTravelCrew()
surprise_travel_crew.crew = surprise_travel_crew.create_crew()
tru_suprise_travel_crew = TruCustomApp(
surprise_travel_crew,
app_name="SurpriseTravelCrew",
app_version="1.0.0",
feedbacks=[],
)
from surprise_travel.crew import SurpriseTravelCrew
surprise_travel_crew = SurpriseTravelCrew()
surprise_travel_crew.crew = surprise_travel_crew.create_crew()
tru_suprise_travel_crew = TruCustomApp(
surprise_travel_crew,
app_name="SurpriseTravelCrew",
app_version="1.0.0",
feedbacks=[],
)
In [ ]:
Copied!
inputs = {
"origin": "São Paulo, GRU",
"destination": "New York, JFK",
"age": 31,
"hotel_location": "Brooklyn",
"flight_information": "GOL 1234, leaving at June 30th, 2024, 10:00",
"trip_duration": "3 days",
}
inputs = {
"origin": "São Paulo, GRU",
"destination": "New York, JFK",
"age": 31,
"hotel_location": "Brooklyn",
"flight_information": "GOL 1234, leaving at June 30th, 2024, 10:00",
"trip_duration": "3 days",
}
In [ ]:
Copied!
# run without trulens:
# result = surprise_travel_crew.crew.kickoff(inputs=inputs)
# run without trulens:
# result = surprise_travel_crew.crew.kickoff(inputs=inputs)
In [ ]:
Copied!
with tru_suprise_travel_crew as recorder:
result = surprise_travel_crew.crew.kickoff(inputs=inputs)
with tru_suprise_travel_crew as recorder:
result = surprise_travel_crew.crew.kickoff(inputs=inputs)
In [ ]:
Copied!
for record in recorder.records:
print(record.record_id)
print(record)
for record in recorder.records:
print(record.record_id)
print(record)