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

feat(llmobs): store function name for function call cases #8988

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

Yun-Kim
Copy link
Contributor

@Yun-Kim Yun-Kim commented Apr 15, 2024

This PR adds two small changes as a follow up to #8950:

  1. Perform the same formatting [tool: <function_name>]\n\n<function_args> for non-streamed cases as streamed cases
  2. Add function names for the deprecated function_call feature (as opposed to the tool_call option)

This only affects LLMObs payloads (not APM traces), so this doesn't need a changelog.

Checklist

  • Change(s) are motivated and described in the PR description
  • Testing strategy is described if automated tests are not included in the PR
  • Risks are described (performance impact, potential for breakage, maintainability)
  • Change is maintainable (easy to change, telemetry, documentation)
  • Library release note guidelines are followed or label changelog/no-changelog is set
  • Documentation is included (in-code, generated user docs, public corp docs)
  • Backport labels are set (if applicable)
  • If this PR changes the public interface, I've notified @DataDog/apm-tees.

Reviewer Checklist

  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Description motivates each change
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Change is maintainable (easy to change, telemetry, documentation)
  • Release note makes sense to a user of the library
  • Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

@Yun-Kim Yun-Kim added the changelog/no-changelog A changelog entry is not required for this PR. label Apr 15, 2024
@Yun-Kim Yun-Kim requested a review from a team as a code owner April 15, 2024 15:41
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Apr 15, 2024

Datadog Report

Branch report: yunkim/llmobs-openai-tool-call-stream
Commit report: cd1ceda
Test service: dd-trace-py

✅ 0 Failed, 950 Passed, 2242 Skipped, 20m 37.82s Total duration (58m 0.61s time saved)

@pr-commenter
Copy link

pr-commenter bot commented Apr 15, 2024

Benchmarks

Benchmark execution time: 2024-04-15 21:07:35

Comparing candidate commit 587c96d in PR branch yunkim/llmobs-openai-tool-call-stream with baseline commit 60763e1 in branch main.

Found 7 performance improvements and 1 performance regressions! Performance is the same for 193 metrics, 9 unstable metrics.

scenario:flasksimple-appsec-telemetry

  • 🟩 execution_time [-261.509µs; -211.720µs] or [-4.019%; -3.254%]

scenario:httppropagationextract-datadog_tracecontext_tracestate_not_propagated_on_trace_id_no_match

  • 🟥 max_rss_usage [+692.972KB; +768.072KB] or [+3.275%; +3.630%]

scenario:httppropagationinject-ids_only

  • 🟩 max_rss_usage [-772.821KB; -722.628KB] or [-3.531%; -3.301%]

scenario:httppropagationinject-with_dd_origin

  • 🟩 max_rss_usage [-1.073MB; -1.024MB] or [-4.909%; -4.687%]

scenario:httppropagationinject-with_sampling_priority

  • 🟩 max_rss_usage [-771.830KB; -714.198KB] or [-3.529%; -3.265%]

scenario:httppropagationinject-with_tags

  • 🟩 max_rss_usage [-675.301KB; -624.360KB] or [-3.085%; -2.852%]

scenario:httppropagationinject-with_tags_invalid

  • 🟩 max_rss_usage [-613.182KB; -561.551KB] or [-2.807%; -2.571%]

scenario:httppropagationinject-with_tags_max_size

  • 🟩 max_rss_usage [-627.663KB; -578.609KB] or [-2.873%; -2.648%]

@Yun-Kim Yun-Kim force-pushed the yunkim/llmobs-openai-tool-call-stream branch from 470d8ac to 587c96d Compare April 15, 2024 20:03
Copy link
Contributor

@sabrenner sabrenner left a comment

Choose a reason for hiding this comment

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

lgtm

@Yun-Kim Yun-Kim enabled auto-merge (squash) April 16, 2024 16:00
@Yun-Kim Yun-Kim merged commit cee04ad into main Apr 16, 2024
71 checks passed
@Yun-Kim Yun-Kim deleted the yunkim/llmobs-openai-tool-call-stream branch April 16, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants