MCPcopy
hub / github.com/langchain-ai/langchain / dumpd

Function dumpd

libs/core/langchain_core/load/dump.py:44–58  ·  view source on GitHub ↗

Return a dict representation of an object. Note: Unfortunately this function is not as efficient as it could be because it first dumps the object to a json string and then loads it back into a dictionary. Args: obj: The object to dump. Returns:

(obj: Any)

Source from the content-addressed store, hash-verified

42
43
44def dumpd(obj: Any) -> Any:
45 """Return a dict representation of an object.
46
47 Note:
48 Unfortunately this function is not as efficient as it could be
49 because it first dumps the object to a json string and then loads it
50 back into a dictionary.
51
52 Args:
53 obj: The object to dump.
54
55 Returns:
56 dictionary that can be serialized to json using json.dumps
57 """
58 return json.loads(dumps(obj))

Callers 15

test_load_openai_llmFunction · 0.90
test_load_openai_chatFunction · 0.90
test_serdes_messageFunction · 0.90
astreamMethod · 0.90
test_bind_bindFunction · 0.90
invokeMethod · 0.90
ainvokeMethod · 0.90
_complete_llm_runMethod · 0.90

Calls 1

dumpsFunction · 0.85

Tested by 12

test_load_openai_llmFunction · 0.72
test_load_openai_chatFunction · 0.72
test_serdes_messageFunction · 0.72
astreamMethod · 0.72
test_bind_bindFunction · 0.72
test_load_openai_llmFunction · 0.72
test_load_llmchainFunction · 0.72
test_load_llmchain_envFunction · 0.72