Skip to content

Commit

Permalink
Review change
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwiktrammer committed Oct 3, 2024
1 parent 592ef56 commit 542bb62
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions packages/ragbits-dev-kit/src/ragbits/dev_kit/prompt_lab/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ class PromptState:
llm_model_name: str | None = None
llm_api_key: str | None = None

def copy(self, **kwargs: Any) -> "PromptState":
"""
Creates a copy of the current state with updated values.
Args:
**kwargs (Any): The updated values to be applied to the copied state.
Returns:
PromptState: A copy of the current state with the updated values.
"""
return replace(self, **kwargs)


def render_prompt(index: int, system_prompt: str, user_prompt: str, state: gr.State, *args: Any) -> gr.State:
"""
Expand Down Expand Up @@ -71,7 +59,7 @@ def render_prompt(index: int, system_prompt: str, user_prompt: str, state: gr.St
variables = {field["field_name"]: value for field, value in zip(input_fields, args)}
input_data = input_type(**variables) if input_type is not None else None
prompt_object = prompt_class(input_data=input_data)
state = state.copy(rendered_prompt=prompt_object)
state = replace(state, rendered_prompt=prompt_object)

return state

Expand Down Expand Up @@ -234,6 +222,5 @@ def show_split(index: int, state: gr.State) -> None:
[prompts_state],
)
llm_request_button.click(send_prompt_to_llm, prompts_state, llm_prompt_response)
prompt_selection_dropdown.change(list_prompt_choices, prompts_state)

gr_app.launch()

0 comments on commit 542bb62

Please sign in to comment.