Skip to content
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

[BUG]Nova doesn't work #629

Open
HirokiNakatani opened this issue Dec 5, 2024 · 9 comments · May be fixed by #645
Open

[BUG]Nova doesn't work #629

HirokiNakatani opened this issue Dec 5, 2024 · 9 comments · May be fixed by #645
Assignees
Labels
bug Something isn't working planned Top-priority enhancements selected for likely implementation.

Comments

@HirokiNakatani
Copy link

Describe the bug

If you select Nova to chat with an existing RAG bot, an error will occur.

{69CDFA60-07B8-4F66-B959-37ACD833C9F5}
{DDEEDBC7-B908-4FF7-A361-F40B9A60594D}

@axelpina
Copy link

axelpina commented Dec 5, 2024

This seems to be also happening with the other models aswell.

@HirokiNakatani
Copy link
Author

In other models, it occurs after several exchanges, but in nova, it occurs from the beginning to the end.

@HirokiNakatani
Copy link
Author

This occurs on all nova series.

@statefb
Copy link
Contributor

statefb commented Dec 6, 2024

Please provide cloudwatch logs for websocket handler.

@statefb statefb added the needs-info Need more information such as reproduction step label Dec 6, 2024
@axelpina
Copy link

axelpina commented Dec 6, 2024

Please provide cloudwatch logs for websocket handler.

Please let me know if this is sufficient information

image

I believe the Bedrock API is reporting that a guardContent field is empty for one of the ContentBlock objects. When handling a user message and applying guardrails with grounding_source, the code returns a list with {"guardContent": grounding_source} as the first item. If the grounding_source is missing or does not contain the required text fields, Bedrock rejects the request.

if (
    role == "user"
    and guardrail
    and guardrail.grounding_threshold > 0
    and grounding_source
):
    return [
        {"guardContent": grounding_source},
        {
            "guardContent": {
                "text": {"text": c.body, "qualifiers": ["query"]}
            }
        },
    ]

If grounding_source is empty or does not contain a text field, the first element in this returned list will have empty guard content.

EDIT: My Cloudwatch logs show a completely different issue vs. the one from the OP. I've made a new ticket to keep things better organized: #637

@HirokiNakatani
Copy link
Author

Provides cloudwatch logs for websocket handlers.

{75B4D4F4-2855-4246-9739-C065B6E9190F}

@lopez-hector
Copy link

lopez-hector commented Dec 6, 2024

We're currently inspecting this. It seems to be happening when the tool config input scheme has the "title" key.

Please let me know if you can fix the error by deleting this key when Nova is selected.

We're working on testing more thoroughly now. We've had success by deleting the title key in the toolConfig.

'toolConfig': {
    'tools': [
        {
            'toolSpec': {
                'name': 'internet_search',
                'description': 'Search the internet for information.',
                'inputSchema': {
                    'json': {
                        'properties': {
                            'query': {
                                'description': 'The query to search for on the internet.',
                                'title': 'Query',
                                'type': 'string'
                            },
                            'country': {
                                'description': 'The country code you wish for search. Must be one of: jp-jp (Japan), kr-kr (Korea), cn-zh (China), fr-fr (France), de-de (Germany), es-es (Spain), it-it (Italy), us-en (United States)',
                                'title': 'Country',
                                'type': 'string'
                            },
                            'time_limit': {
                                'description': "The time limit for the search. Options are 'd' (day), 'w' (week), 'm' (month), 'y' (year).",
                                 'title': 'Time Limit',
                                 'type': 'string'
                            }
                        },
                       'required': ['query', 'country', 'time_limit'],
                       'title': 'InternetSearchInput', # This KEY
                       'type': 'object'
                   }
               }
           }
       }
   ]
}

@statefb statefb added bug Something isn't working identified Indicates that the root cause of the bug has been determined. and removed needs-info Need more information such as reproduction step labels Dec 9, 2024
@statefb
Copy link
Contributor

statefb commented Dec 9, 2024

@lopez-hector Thank you for your detailed investigation. As you mentioned, official doc says that no need to add title to the request. We'll fix this bug (cannot tell the ETA) but it'd be nice if you could create a PR. Thank you for your understanding.

@axelpina
Copy link

We're currently inspecting this. It seems to be happening when the tool config input scheme has the "title" key.

Please let me know if you can fix the error by deleting this key when Nova is selected.

We're working on testing more thoroughly now. We've had success by deleting the title key in the toolConfig.

'toolConfig': {
    'tools': [
        {
            'toolSpec': {
                'name': 'internet_search',
                'description': 'Search the internet for information.',
                'inputSchema': {
                    'json': {
                        'properties': {
                            'query': {
                                'description': 'The query to search for on the internet.',
                                'title': 'Query',
                                'type': 'string'
                            },
                            'country': {
                                'description': 'The country code you wish for search. Must be one of: jp-jp (Japan), kr-kr (Korea), cn-zh (China), fr-fr (France), de-de (Germany), es-es (Spain), it-it (Italy), us-en (United States)',
                                'title': 'Country',
                                'type': 'string'
                            },
                            'time_limit': {
                                'description': "The time limit for the search. Options are 'd' (day), 'w' (week), 'm' (month), 'y' (year).",
                                 'title': 'Time Limit',
                                 'type': 'string'
                            }
                        },
                       'required': ['query', 'country', 'time_limit'],
                       'title': 'InternetSearchInput', # This KEY
                       'type': 'object'
                   }
               }
           }
       }
   ]
}

As far as I am aware the issue seems to stem from the _generate_input_schema method (in agent_tool.py) . If possible, could you explain how you're removing the title key from the JSON?

@Yukinobu-Mine Yukinobu-Mine self-assigned this Dec 11, 2024
@Yukinobu-Mine Yukinobu-Mine added planned Top-priority enhancements selected for likely implementation. and removed identified Indicates that the root cause of the bug has been determined. labels Dec 11, 2024
@Yukinobu-Mine Yukinobu-Mine linked a pull request Dec 12, 2024 that will close this issue
@Yukinobu-Mine Yukinobu-Mine linked a pull request Dec 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working planned Top-priority enhancements selected for likely implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants