MetaProvider#
- class langchain_community.chat_models.oci_generative_ai.MetaProvider[source]#
Attributes
stop_sequence_key
Methods
__init__
()chat_generation_info
(response)chat_response_to_text
(response)chat_stream_generation_info
(event_data)chat_stream_to_text
(event_data)convert_to_oci_tool
(tool)get_role
(message)is_chat_stream_end
(event_data)messages_to_oci_params
(messages, **kwargs)Convert LangChain messages to OCI chat parameters.
- chat_generation_info(response: Any) Dict[str, Any] [source]#
- Parameters:
response (Any)
- Return type:
Dict[str, Any]
- chat_stream_generation_info(event_data: Dict) Dict[str, Any] [source]#
- Parameters:
event_data (Dict)
- Return type:
Dict[str, Any]
- convert_to_oci_tool(tool: Dict[str, Any] | Type[BaseModel] | Callable | BaseTool) Dict[str, Any] [source]#
- Parameters:
tool (Dict[str, Any] | Type[BaseModel] | Callable | BaseTool)
- Return type:
Dict[str, Any]
- get_role(message: BaseMessage) str [source]#
- Parameters:
message (BaseMessage)
- Return type:
str
- messages_to_oci_params(messages: List[BaseMessage], **kwargs: Any) Dict[str, Any] [source]#
Convert LangChain messages to OCI chat parameters.
- Parameters:
messages (List[BaseMessage]) – List of LangChain BaseMessage objects
**kwargs (Any) – Additional keyword arguments
- Returns:
Dict containing OCI chat parameters
- Raises:
ValueError – If message content is invalid
- Return type:
Dict[str, Any]