Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions chatsky/conditions/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class LLMCondition(BaseCondition):
"""
Condition prompt.
"""
history: int = 1
context_window: int = 1
"""
Number of dialogue turns aside from the current one to keep in history. `-1` for full history.
Number of dialogue turns aside from the current one to keep in history. `-1` to put all messages into the context.
"""
filter_func: BaseHistoryFilter = Field(default_factory=DefaultFilter)
"""
Expand Down Expand Up @@ -67,7 +67,7 @@ async def call(self, ctx: Context) -> bool:
call_prompt=Prompt(message=self.prompt),
prompt_misc_filter=self.prompt_misc_filter,
position_config=self.position_config or model.position_config,
length=self.history,
length=self.context_window,
filter_func=self.filter_func,
llm_model_name=self.llm_model_name,
max_size=self.max_size,
Expand Down
6 changes: 3 additions & 3 deletions chatsky/llm/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class PositionConfig(BaseModel):
"""

system_prompt: float = 0
history: float = 1
misc_prompt: float = 2
call_prompt: float = 3
misc_prompt: float = 1
call_prompt: float = 2
history: float = 3
last_turn: float = 4


Expand Down
6 changes: 3 additions & 3 deletions chatsky/responses/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class LLMResponse(BaseResponse):
"""
Response prompt.
"""
history: int = 5
context_window: int = 5
"""
Number of dialogue turns aside from the current one to keep in history. `-1` for full history.
Number of dialogue turns aside from the current one to keep in history. `-1` to put all messages into the context.
"""
filter_func: BaseHistoryFilter = Field(default_factory=DefaultFilter)
"""
Expand Down Expand Up @@ -68,7 +68,7 @@ async def call(self, ctx: Context) -> Message:
call_prompt=self.prompt,
prompt_misc_filter=self.prompt_misc_filter,
position_config=self.position_config or model.position_config,
length=self.history,
length=self.context_window,
filter_func=self.filter_func,
llm_model_name=self.llm_model_name,
max_size=self.max_size,
Expand Down
6 changes: 3 additions & 3 deletions tutorials/llm/2_prompt_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
prompt types are ordered in the conversation history. The default hierarchy is:

1. `system_prompt` - Core instructions for the model
2. `history` - Conversation context
3. `misc_prompt` - Additional prompts from nodes/flows
4. `call_prompt` - Direct response prompts
2. `misc_prompt` - Additional prompts from nodes/flows
3. `call_prompt` - Direct response prompts
4. `history` - Conversation context
5. `last_turn` - Request and response from the current turn
(if response has not yet been generated during current turn,
only request is included)
Expand Down
Loading