Skip to content

Commit

Permalink
add code back
Browse files Browse the repository at this point in the history
  • Loading branch information
bboynton97 committed Aug 9, 2024
1 parent b6f2832 commit 2734e08
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions agentops/partners/langchain_callback_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
from agentops.helpers import get_ISO_time

from ..helpers import debug_print_function_params
import os
from ..log_config import logger
import logging


def get_model_from_kwargs(kwargs: any) -> str:
Expand Down Expand Up @@ -44,12 +46,24 @@ def __init__(
endpoint: Optional[str] = None,
max_wait_time: Optional[int] = None,
max_queue_size: Optional[int] = None,
default_tags: Optional[List[str]] = None,
):
logging_level = os.getenv("AGENTOPS_LOGGING_LEVEL")
log_levels = {
"CRITICAL": logging.CRITICAL,
"ERROR": logging.ERROR,
"INFO": logging.INFO,
"WARNING": logging.WARNING,
"DEBUG": logging.DEBUG,
}
logger.setLevel(log_levels.get(logging_level or "INFO", "INFO"))

client_params: Dict[str, Any] = {
"api_key": api_key,
"endpoint": endpoint,
"max_wait_time": max_wait_time,
"max_queue_size": max_queue_size,
"default_tags": default_tags,
}

self.ao_client = AOClient()
Expand Down

0 comments on commit 2734e08

Please sign in to comment.