MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / get_extra_headers

Function get_extra_headers

client-libs/python/openpipe/shared.py:33–46  ·  view source on GitHub ↗
(create_kwargs, openpipe_options)

Source from the content-addressed store, hash-verified

31
32
33def get_extra_headers(create_kwargs, openpipe_options):
34 extra_headers = create_kwargs.pop("extra_headers", {})
35 # Default to true
36 if extra_headers.get("op-log-request", None) == None:
37 extra_headers["op-log-request"] = (
38 "false" if openpipe_options.get("log_request") == False else "true"
39 )
40 # Default to false
41 if extra_headers.get("op-cache", None) == None:
42 extra_headers["op-cache"] = (
43 "true" if openpipe_options.get("cache") == True else "false"
44 )
45 extra_headers["op-tags"] = json.dumps(_get_tags(openpipe_options))
46 return extra_headers
47
48
49def _get_tags(openpipe_options):

Callers 2

createMethod · 0.85
createMethod · 0.85

Calls 1

_get_tagsFunction · 0.85

Tested by

no test coverage detected