Skip to content

Commit

Permalink
chore: update docstring to Synthesis Strategies
Browse files Browse the repository at this point in the history
  • Loading branch information
umbertogriffo committed Dec 29, 2023
1 parent 0660c3a commit 253aac6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions chatbot/bot/conversation/ctx_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def generate_response(
max_new_tokens (int, optional): Maximum number of tokens for the generated response. Default is 512.
Returns:
Union[str, Any]: The generated response or a response generator.
Any: A response generator.
"""
cur_response = None
Expand Down Expand Up @@ -124,7 +124,7 @@ def __init__(self, llm: LlmClient):

def generate_response(
self, retrieved_contents: List[Document], question: str, max_new_tokens: int = 512, num_children: int = 2
) -> Union[str, Any]:
) -> Any:
"""
Generate a response using hierarchical summarization strategy.
Expand All @@ -136,7 +136,7 @@ def generate_response(
num_children (int, optional): Number of child nodes to create for the response. Default is 2.
Returns:
Union[str, Any]: The generated response.
Any: A response generator.
"""
fmt_prompts = []
node_responses = []
Expand Down Expand Up @@ -177,7 +177,7 @@ def combine_results(
num_children (int, optional): Number of child nodes to create for the response. Default is 2.
Returns:
Any: The combined response.
Any: A response generator.
"""
fmt_prompts = []
new_texts = []
Expand Down Expand Up @@ -235,7 +235,7 @@ async def generate_response(
num_children (int, optional): The number of child nodes to create for the response. Default is 2.
Returns:
Any: The combined response.
Any: A response generator.
"""
fmt_prompts = []
for idx, content in enumerate(retrieved_contents, start=1):
Expand Down Expand Up @@ -276,7 +276,7 @@ async def combine_results(
num_children (int, optional): Number of child nodes to create for the response. Default is 2.
Returns:
Any: The combined response.
Any: A response generator.
"""
fmt_prompts = []
for idx in range(0, len(texts), num_children):
Expand Down

0 comments on commit 253aac6

Please sign in to comment.