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

Fix: Nova doesn't work #645

Open
wants to merge 10 commits into
base: v2
Choose a base branch
from
Open

Fix: Nova doesn't work #645

wants to merge 10 commits into from

Conversation

Yukinobu-Mine
Copy link
Contributor

@Yukinobu-Mine Yukinobu-Mine commented Dec 12, 2024

Issue #, if available:
Closes #629

Description of changes:

  • If model is Amazon Nova, combine multiple system prompts into one text. 8084a30
  • If model is Amazon Nova, set the upper limit of topK to 128. 4ec0465
  • Remove title key from input JSON schema of AgentTool. dd979e0
  • Optimization for Amazon Nova. 493b012
    • Change the system prompt when doing 'Retrieved Context Citation' with Amazon Nova.
    • If the tool result has more than one element, pass it as single text content formatted as JSON array.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

- Change the system prompt when doing 'Retrieved Context Citation' with Amazon Nova.
- If the tool result has more than one element, pass it as single text content formatted as JSON array.
@Yukinobu-Mine Yukinobu-Mine linked an issue Dec 12, 2024 that may be closed by this pull request
@Yukinobu-Mine Yukinobu-Mine force-pushed the 629-bugnova-doesnt-work branch from d6d3360 to 8023c93 Compare December 12, 2024 16:30
@Yukinobu-Mine Yukinobu-Mine force-pushed the 629-bugnova-doesnt-work branch from 8023c93 to bae8d4e Compare December 12, 2024 16:34
backend/app/repositories/models/conversation.py Outdated Show resolved Hide resolved
backend/app/prompt.py Outdated Show resolved Hide resolved
backend/app/agents/tools/agent_tool.py Show resolved Hide resolved
backend/app/bedrock.py Show resolved Hide resolved
- `RemoveTitle` in app/agents/tools/agent_tool.py
- `_prepare_nova_model_params()` in app/bedrock.py
- `build_rag_prompt()` and `get_prompt_to_cite_tool_results()` in app/prompt.py
- `BaseTool` -> `AgentTool` in docs/AGENT.md
- To avoid circular imports, add `from __future__ import annotations` and `if TYPE_CHECKING` to app/bedrock.py
]
from app.bedrock import is_nova_model

if is_nova_model(model=model):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前回のレビューで漏れてすみません!related_document.to_tool_result_modelにmodel渡して分岐する方が、同等の処理が一箇所にまとまるため可読性が良いとも思いましたが、いかがでしょうか?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]Nova doesn't work
2 participants