fix: runtime error when OTEL is not enabled (#138)

Symptom: If an `otel_meter` wasnot passed when constructing the actor
(which is allowed, it's an optional param), the actor would later crash
at runtime.

Fix: Always set `tool_counter` to a default value.
This commit is contained in:
Nate Barbettini 2024-11-01 12:38:54 -07:00 committed by GitHub
parent 3699b16b2d
commit 8b29407d2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -55,6 +55,8 @@ class BaseActor(Actor):
self.secret = self._set_secret(secret, disable_auth)
self.environment = os.environ.get("ARCADE_ENVIRONMENT", "local")
self.tool_counter = None
if otel_meter:
self.tool_counter = otel_meter.create_counter(
"tool_call", "requests", "Total number of tools called"

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "arcade-ai"
version = "0.1.0"
version = "0.1.1"
description = ""
packages = [
{include="arcade", from="."}