diff --git a/examples/chatbot/basic-examples/README.md b/examples/chatbot/basic-examples/README.md index d9b6eacf..11c48d25 100644 --- a/examples/chatbot/basic-examples/README.md +++ b/examples/chatbot/basic-examples/README.md @@ -63,9 +63,6 @@ logger.add_llm_span( # Conclude the trace logger.conclude(output=response.choices[0].message.content.strip()) - -# Flush the traces to Splunk AO -logger.flush() ``` This approach gives you more control over what gets logged and when, allowing you to: diff --git a/examples/chatbot/basic-examples/hallucination.py b/examples/chatbot/basic-examples/hallucination.py index d781114f..06007215 100644 --- a/examples/chatbot/basic-examples/hallucination.py +++ b/examples/chatbot/basic-examples/hallucination.py @@ -101,6 +101,3 @@ def run_hallucination_demo(): # Run the main demonstration results = run_hallucination_demo() - - # Flush the traces to Splunk AO - logger.flush() diff --git a/examples/chatbot/basic-examples/test.py b/examples/chatbot/basic-examples/test.py index a0b40457..039b5ad6 100644 --- a/examples/chatbot/basic-examples/test.py +++ b/examples/chatbot/basic-examples/test.py @@ -54,8 +54,5 @@ # Conclude the trace logger.conclude(output=response_content) -# Flush the traces to Splunk AO -logger.flush() - # Print the response print(response_content) diff --git a/examples/logging-samples/splunk-ao-logger/basic-example.py b/examples/logging-samples/splunk-ao-logger/basic-example.py index d5c53d43..4b52a487 100644 --- a/examples/logging-samples/splunk-ao-logger/basic-example.py +++ b/examples/logging-samples/splunk-ao-logger/basic-example.py @@ -29,9 +29,6 @@ # Conclude the trace with the final output logger.conclude(output="Hello, this is a test", duration_ns=1000) -# Flush the trace to Splunk AO -logger.flush() - # Show link to Splunk AO log stream config = SplunkAOConfig.get() diff --git a/examples/logging-samples/splunk-ao-logger/metadata-example.py b/examples/logging-samples/splunk-ao-logger/metadata-example.py index 16483e22..0a4a6186 100644 --- a/examples/logging-samples/splunk-ao-logger/metadata-example.py +++ b/examples/logging-samples/splunk-ao-logger/metadata-example.py @@ -27,9 +27,6 @@ # Conclude the trace with the final output logger.conclude(output_answer) -# Flush the trace to Splunk AO -logger.flush() - # Show link to Splunk AO log stream config = SplunkAOConfig.get() project_url = f"{config.console_url}project/{logger.project_id}" diff --git a/examples/logging-samples/splunk-ao-logger/redaction-example.py b/examples/logging-samples/splunk-ao-logger/redaction-example.py index 3768bad8..0f31dca7 100644 --- a/examples/logging-samples/splunk-ao-logger/redaction-example.py +++ b/examples/logging-samples/splunk-ao-logger/redaction-example.py @@ -19,8 +19,6 @@ redacted_input = user_input.replace(sensitive_info, "***") trace = logger.start_trace(input=user_input, redacted_input=redacted_input) -logger.flush() # send the trace to Splunk AO - # Example of how to create "redacted_input", matching email as sensitive info # --------------------------------------------------------------------------- @@ -37,8 +35,6 @@ else: trace = logger.start_trace(input=user_input) -logger.flush() # send the trace to Splunk AO - # It's also possible to use a service such as https://www.private-ai.com/ to create the redacted_input # Export the logged traces in the logstream diff --git a/examples/logging-samples/splunk-ao-logger/retriever-example.py b/examples/logging-samples/splunk-ao-logger/retriever-example.py index 68032ad5..5b1b5333 100644 --- a/examples/logging-samples/splunk-ao-logger/retriever-example.py +++ b/examples/logging-samples/splunk-ao-logger/retriever-example.py @@ -55,9 +55,6 @@ logger.conclude(output="This is another trace conclude", duration_ns=1000) - # Flush the traces to splunk_ao - logger.flush() - # Show link to Splunk AO log stream config = SplunkAOConfig.get() diff --git a/splunk-ao-migration-tool/README.md b/splunk-ao-migration-tool/README.md index 250c0f95..672d00d5 100644 --- a/splunk-ao-migration-tool/README.md +++ b/splunk-ao-migration-tool/README.md @@ -391,7 +391,6 @@ logger = GalileoLogger(project="my-project", log_stream="production") logger.start_session(name="my-session") logger.add_llm_span(input="Hello", output="Hi", model="gpt-4") logger.conclude() # closes current span; no flush kwarg -logger.flush() # uploads traces ``` ### After (splunk-ao) @@ -418,7 +417,6 @@ logger = SplunkAOLogger(project="my-project", agent_stream="production") logger.start_session(name="my-session") logger.add_llm_span(input="Hello", output="Hi", model="gpt-4") logger.conclude() # closes current span; no flush kwarg -logger.flush() # uploads traces ``` --- diff --git a/splunk-ao-migration-tool/examples/after_splunk_ao.py b/splunk-ao-migration-tool/examples/after_splunk_ao.py index 6ee59db7..29369c6f 100644 --- a/splunk-ao-migration-tool/examples/after_splunk_ao.py +++ b/splunk-ao-migration-tool/examples/after_splunk_ao.py @@ -21,4 +21,3 @@ def call_llm(prompt: str) -> str: logger.start_session(name="my-session") logger.add_llm_span(input="Hello", output="Hi", model="gpt-4") logger.conclude() # closes current span; no flush kwarg -logger.flush() # uploads traces diff --git a/splunk-ao-migration-tool/examples/before_galileo.py b/splunk-ao-migration-tool/examples/before_galileo.py index 7f7c1433..3c70b763 100644 --- a/splunk-ao-migration-tool/examples/before_galileo.py +++ b/splunk-ao-migration-tool/examples/before_galileo.py @@ -21,4 +21,3 @@ def call_llm(prompt: str) -> str: logger.start_session(name="my-session") logger.add_llm_span(input="Hello", output="Hi", model="gpt-4") logger.conclude() # closes current span; no flush kwarg -logger.flush() # uploads traces diff --git a/src/splunk_ao/logger/logger.py b/src/splunk_ao/logger/logger.py index 8ebd8937..f7213c3b 100644 --- a/src/splunk_ao/logger/logger.py +++ b/src/splunk_ao/logger/logger.py @@ -208,7 +208,6 @@ class SplunkAOLogger(TracesLogger): duration_ns=1000 ) logger.conclude(output="I am!", duration_ns=2000) - logger.flush() ``` """