langchain-ai / langserve

LangServe 🦜️🏓
Other
1.89k stars 211 forks source link

is their a way customize my output, like drop "metadata" #650

Open yaohwang opened 4 months ago

yaohwang commented 4 months ago

{"output":"ashes","metadata":{"run_id":"cb043b82-d879-43fa-8625-c326509bc822","feedback_tokens":[]}}

I don't really want "metadata", and maybe add "session_id", how can I do this? I'm now using langserve add_routes to complete this.

eyurtsev commented 4 months ago

Metadata cannot be modified. For session_id the only place where you can put it right now is as part of the output.

yaohwang commented 4 months ago

Metadata cannot be modified. For session_id the only place where you can put it right now is as part of the output.

hi eyurtsev, I think it maybe required for application developer's like me, since langserve is used for web service, if we can change (add or delete) the output json elements, then we can use langserve directly for application.

the metadata or something else maybe useful for langserve itself or LangSmith etc., but not the final application somehow.