-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChatBedrockConverse compatibility issue #7
Comments
@arthberman Lines 469 to 482 in dc5e634
Here is a small change to def _format_tools(
tools: Sequence[Union[Dict[str, Any], TypeBaseModel, Callable, BaseTool],],
) -> List[Dict[Literal["toolSpec"], Dict[str, Union[Dict[str, Any], str]]]]:
formatted_tools: List = []
for tool in tools:
if isinstance(tool, dict) and "toolSpec" in tool:
formatted_tools.append(tool)
else:
if isinstance(tool, dict) and "function" in tool:
tool = tool["function"]
spec = convert_to_openai_function(tool)
if not spec["description"]:
spec["description"] = spec["name"]
spec["inputSchema"] = {"json": spec.pop("parameters")}
formatted_tools.append({"toolSpec": spec})
return formatted_tools Here is the output after the change. {
"pertinent_user_preferences": {
"communication_preferences": {
"telegram": {
"preferred_encoding": [
{
"preference": "Morse code",
"sentence_preference_revealed": "Customer prefers Morse code for encoding the telegram."
}
],
"favorite_telegram_operators": [
{
"preference": "<UNKNOWN>",
"sentence_preference_revealed": "No specific favorite telegram operator mentioned."
}
],
"preferred_telegram_paper": [
{
"preference": "Daredevil",
"sentence_preference_revealed": "Customer agrees to use 'Daredevil' paper for the telegram."
}
]
},
"morse_code": {
"preferred_key_type": [
{
"preference": "straight key",
"sentence_preference_revealed": "Customer expresses love for using a straight key for Morse code."
}
],
"favorite_morse_abbreviations": [
{
"preference": "<UNKNOWN>",
"sentence_preference_revealed": "No specific favorite Morse abbreviations mentioned."
}
]
},
"semaphore": {
"preferred_flag_color": [
{
"preference": "<UNKNOWN>",
"sentence_preference_revealed": "No information provided about semaphore flag color preferences."
}
],
"semaphore_skill_level": [
{
"preference": "<UNKNOWN>",
"sentence_preference_revealed": "No information provided about semaphore skill level."
}
]
}
},
"trust_fall_preferences": {
"preferred_fall_height": [
{
"preference": "higher",
"sentence_preference_revealed": "Customer expresses readiness for a higher fall in the trust fall exercise."
}
],
"trust_level": [
{
"preference": "high",
"sentence_preference_revealed": "Customer shows a high level of trust by being ready for a higher fall."
}
],
"preferred_catching_technique": [
{
"preference": "diamond formation",
"sentence_preference_revealed": "Customer prefers the diamond formation for catching during the trust fall."
}
]
}
}
} |
@3coins |
I use "llama3.2:3b-instruct-fp16" with ChatOllama with provided samples in package , but there is errors: `from trustcall import create_extractor ) could anyone help me? |
@3coins |
It's working fine with ChatOpenAI but it seems not compatible with ChatBedrockConverse, any help on that ?
Many thks, really appreciate this lib :)
The text was updated successfully, but these errors were encountered: