forked from phoenix/litellm-mirror
(code clean up) use a folder for gcs bucket logging + add readme in folder (#6080)
* refactor gcs bucket * add readme
This commit is contained in:
parent
6e6d38841f
commit
3cb04480fb
7 changed files with 21 additions and 6 deletions
12
litellm/integrations/gcs_bucket/Readme.md
Normal file
12
litellm/integrations/gcs_bucket/Readme.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# GCS (Google Cloud Storage) Bucket Logging on LiteLLM Gateway
|
||||
|
||||
This folder contains the GCS Bucket Logging integration for LiteLLM Gateway.
|
||||
|
||||
## Folder Structure
|
||||
|
||||
- `gcs_bucket.py`: This is the main file that handles failure/success logging to GCS Bucket
|
||||
- `gcs_bucket_base.py`: This file contains the GCSBucketBase class which handles Authentication for GCS Buckets
|
||||
|
||||
## Further Reading
|
||||
- [Doc setting up GCS Bucket Logging on LiteLLM Proxy (Gateway)](https://docs.litellm.ai/docs/proxy/bucket)
|
||||
- [Doc on Key / Team Based logging with GCS](https://docs.litellm.ai/docs/proxy/team_logging)
|
|
@ -11,7 +11,7 @@ from pydantic import BaseModel, Field
|
|||
import litellm
|
||||
from litellm._logging import verbose_logger
|
||||
from litellm.integrations.custom_logger import CustomLogger
|
||||
from litellm.integrations.gcs_bucket_base import GCSBucketBase
|
||||
from litellm.integrations.gcs_bucket.gcs_bucket_base import GCSBucketBase
|
||||
from litellm.litellm_core_utils.logging_utils import (
|
||||
convert_litellm_response_object_to_dict,
|
||||
)
|
|
@ -65,7 +65,7 @@ from ..integrations.clickhouse import ClickhouseLogger
|
|||
from ..integrations.datadog.datadog import DataDogLogger
|
||||
from ..integrations.dynamodb import DyanmoDBLogger
|
||||
from ..integrations.galileo import GalileoObserve
|
||||
from ..integrations.gcs_bucket import GCSBucketLogger
|
||||
from ..integrations.gcs_bucket.gcs_bucket import GCSBucketLogger
|
||||
from ..integrations.greenscale import GreenscaleLogger
|
||||
from ..integrations.helicone import HeliconeLogger
|
||||
from ..integrations.lago import LagoLogger
|
||||
|
|
|
@ -53,9 +53,9 @@ def get_file_contents_from_s3(bucket_name, object_key):
|
|||
|
||||
async def get_config_file_contents_from_gcs(bucket_name, object_key):
|
||||
try:
|
||||
from litellm.integrations.gcs_bucket_base import GCSBucketBase
|
||||
from litellm.integrations.gcs_bucket.gcs_bucket import GCSBucketLogger
|
||||
|
||||
gcs_bucket = GCSBucketBase(
|
||||
gcs_bucket = GCSBucketLogger(
|
||||
bucket_name=bucket_name,
|
||||
)
|
||||
file_contents = await gcs_bucket.download_gcs_object(object_key)
|
||||
|
|
|
@ -5,7 +5,7 @@ from typing import Optional
|
|||
import litellm
|
||||
from litellm._logging import verbose_logger
|
||||
from litellm.caching import InMemoryCache
|
||||
from litellm.integrations.gcs_bucket_base import GCSBucketBase
|
||||
from litellm.integrations.gcs_bucket.gcs_bucket_base import GCSBucketBase
|
||||
from litellm.llms.custom_httpx.http_handler import _get_httpx_client
|
||||
from litellm.proxy._types import CommonProxyErrors, KeyManagementSystem
|
||||
|
||||
|
|
|
@ -16,7 +16,10 @@ import pytest
|
|||
import litellm
|
||||
from litellm import completion
|
||||
from litellm._logging import verbose_logger
|
||||
from litellm.integrations.gcs_bucket import GCSBucketLogger, StandardLoggingPayload
|
||||
from litellm.integrations.gcs_bucket.gcs_bucket import (
|
||||
GCSBucketLogger,
|
||||
StandardLoggingPayload,
|
||||
)
|
||||
from litellm.types.utils import StandardCallbackDynamicParams
|
||||
|
||||
verbose_logger.setLevel(logging.DEBUG)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue