From 3a4db69c85f5641d92a069134ee4c76901df6e02 Mon Sep 17 00:00:00 2001 From: Ali Waleed <134522290+alizenhom@users.noreply.github.com> Date: Wed, 12 Jun 2024 18:43:59 +0300 Subject: [PATCH] adjust readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d59e6ca0..43c3a4ba 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ from langtrace_python_sdk import inject_additional_attributes -def do_llm_stuff(): +def do_llm_stuff(name=""): response = client.chat.completions.create( model="gpt-4", messages=[{"role": "user", "content": "Say this is a test three times"}], @@ -182,8 +182,10 @@ def do_llm_stuff(): def main(): - response = inject_additional_attributes(do_llm_stuff, {'user.id': 'userId'}) + response = inject_additional_attributes(lambda: do_llm_stuff(name="llm"), {'user.id': 'userId'}) + # if the function do not take arguments then this syntax will work + response = inject_additional_attributes(do_llm_stuff, {'user.id': 'userId'}) ``` - `with_additional_attributes` - is behaving the same as `inject_additional_attributes` but as a decorator, this will be deprecated soon.