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:
parent
3699b16b2d
commit
8b29407d2d
2 changed files with 3 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "arcade-ai"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
description = ""
|
||||
packages = [
|
||||
{include="arcade", from="."}
|
||||
|
|
|
|||
Loading…
Reference in a new issue