langgraph_agent_toolkit.helper.utils.check_str_is_http(x)[source][source]
Parameters:

x (str)

Return type:

str

langgraph_agent_toolkit.helper.utils.convert_message_content_to_string(content)[source][source]
Parameters:

content (str | list[str | dict])

Return type:

str

langgraph_agent_toolkit.helper.utils.langchain_to_chat_message(message)[source][source]

Create a ChatMessage from a LangChain message.

Parameters:

message (BaseMessage | dict | BaseModel)

Return type:

ChatMessage

langgraph_agent_toolkit.helper.utils.remove_tool_calls(content)[source][source]

Remove tool calls from content.

Parameters:

content (str | list[str | dict])

Return type:

str | list[str | dict]

langgraph_agent_toolkit.helper.utils.create_ai_message(parts)[source][source]
Parameters:

parts (dict)

Return type:

AIMessage

langgraph_agent_toolkit.helper.utils.read_file(file_path, mode='r', encoding='utf-8', **kwargs)[source][source]

Read the content of a file and return it as a string.

Parameters:
  • file_path (Path | str) – The path to the file to read.

  • mode (str) – The mode in which to open the file. Default is “r”.

  • encoding (str) – The encoding to use for reading the file. Default is “utf-8”.

  • **kwargs – Additional arguments to pass to the open function.

Returns:

The content of the file as a string.

Return type:

Any