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

Revert "feat(sdk): user feedback scores" #253

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 44 additions & 89 deletions packages/sample-app/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/sample-app/sample_app/methods_decorated_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,5 @@ def joke_workflow():
signature = generate_signature(pirate_joke)
print(pirate_joke + "\n\n" + signature)

Traceloop.report_score("chat_id", "chat_9876", 1)


joke_workflow()
28 changes: 1 addition & 27 deletions packages/traceloop-sdk/traceloop/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class Traceloop:
AUTO_CREATED_URL = str(Path.home() / ".cache" / "traceloop" / "auto_created_url")

__tracer_wrapper: TracerWrapper
__fetcher: Fetcher

@staticmethod
def init(
Expand All @@ -58,8 +57,7 @@ def init(
and not exporter
and not processor
):
Traceloop.__fetcher = Fetcher(base_url=api_endpoint, api_key=api_key)
Traceloop.__fetcher.run()
Fetcher(base_url=api_endpoint, api_key=api_key).run()
print(
Fore.GREEN + "Traceloop syncing configuration and prompts" + Fore.RESET
)
Expand Down Expand Up @@ -160,27 +158,3 @@ def set_correlation_id(correlation_id: str) -> None:

def set_association_properties(properties: dict) -> None:
set_association_properties(properties)

def report_score(
association_property_name: str,
association_property_id: str,
score: float,
):
if not Traceloop.__fetcher:
print(
Fore.RED
+ "Error: Cannot report score. Missing Traceloop API key,"
+ " go to https://https://app.traceloop.com/settings/api-keys to create one"
)
print("Set the TRACELOOP_API_KEY environment variable to the key")
print(Fore.RESET)
return

Traceloop.__fetcher.post(
"score",
{
"entity_name": f"traceloop.association.properties.{association_property_name}",
"entity_id": association_property_id,
"score": score,
},
)
Loading
Loading