Skip to content

How to exclude a certain input key from being traced? #1126

Closed Answered by pprobst
pprobst asked this question in Q&A
Discussion options

You must be logged in to vote

The easiest solution was to change the type of the input I wanted to hide to Pydantic's SecretStr:

audio_base64: List[SecretStr] = []

Then, when you need to retrieve the value, you just:

for audio in audio_base64:
    if audio.__class__ == SecretStr:
        audio = audio.get_secret_value()

There are also other solutions, but since I'm using LangSmith with LangServe, just changing the type of one of the inputs to SecretStr works better for me.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pprobst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant