Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Python tracking #3

Merged
merged 8 commits into from
Oct 18, 2024
Merged

Updates to Python tracking #3

merged 8 commits into from
Oct 18, 2024

Conversation

InTheCloudDan
Copy link
Contributor

  • Clean up unneeded comments
  • Switch token classes to be closer to AI Provider types
  • Move from variationDetail which generates an event each time to variation.

@InTheCloudDan InTheCloudDan requested a review from a team as a code owner October 15, 2024 16:55

class LDAIClient:
"""The LaunchDarkly AI SDK client object."""

def __init__(self, client: LDClient):
self.client = client

def model_config(self, key: str, context: Context, default_value: str, variables: Optional[Dict[str, Any]] = None) -> Any:
def model_config(self, key: str, context: Context, default_value: str, variables: Optional[Dict[str, Any]] = None) -> AIConfig:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is returning a dictionary, not an AIConfig type.

Also just noticed there is a rogue print in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keelerm84 updated the logic to return an AIConfig

ldai/tracking_utils.py Outdated Show resolved Hide resolved
ldai/types.py Outdated Show resolved Hide resolved
Remove tracking utils

return AI Config

Remove errant print
from typing import Callable, TypedDict
from dataclasses import dataclass

@dataclass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't typically see both @dataclass and TypedDict used together. Are both of these needed? If so, why not on the other types below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keelerm84 this is a lack of knowledge on my part. I switched them over to dataclasses in the following commit.

@InTheCloudDan InTheCloudDan merged commit 676b7d5 into main Oct 18, 2024
0 of 11 checks passed
@InTheCloudDan InTheCloudDan deleted the dob/trackingUpdates branch October 18, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants