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

Update key for session context field in attributes #34

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

kshitiz-okahu
Copy link
Contributor

@kshitiz-okahu kshitiz-okahu commented Aug 29, 2024

Proposed changes

The key for persisting sessions in attributes has been simplified as discussed in #25

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

tests/langchain_chat_sample.py Outdated Show resolved Hide resolved
@@ -154,7 +154,7 @@ def format_docs(docs):
# "status_code": "UNSET"
# },
# "attributes": {
# "workflow_context_properties.session_id": "0x4fa6d91d1f2a4bdbb7a1287d90ec4a16",
# "context.session_id": "0x4fa6d91d1f2a4bdbb7a1287d90ec4a16",
Copy link
Contributor

@oi-raanne oi-raanne Aug 29, 2024

Choose a reason for hiding this comment

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

as context is a first class object in telemetry, it can confuse the users as json path to fetch would be context.<property name> .My suggestion would be to use either 'invocation' or not to add any prefix

Choose a reason for hiding this comment

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

  • from perspective of capturing and querying these attributes in prompt API, should be fine either way
    • if the span of these attributes is fixed, like root span for eg, it would be easier for prompt API implementation
    • since these attributes are inserted in all spans, including root span, so prompt API implementation should be fine
  • some prefix might be helpful to determine if the attribute came from framework vs custom attribute inserted by user, though not sure if this is needed
    • some possible prefix alternatives could be: state, session, trace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to session.{property_name}

Signed-off-by: Kshitiz Vijayvargiya <kshitiz.vijayvargiya@okahu.ai>
Signed-off-by: Kshitiz Vijayvargiya <kshitiz.vijayvargiya@okahu.ai>
@kshitiz-okahu kshitiz-okahu force-pushed the kshitiz/update_context_key branch from 7a5f4ec to 6033fe0 Compare August 30, 2024 04:03
@kshitiz-okahu kshitiz-okahu merged commit 3bacec1 into main Aug 30, 2024
6 checks passed
@kshitiz-okahu kshitiz-okahu deleted the kshitiz/update_context_key branch November 13, 2024 08:25
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.

3 participants