Skip to content

Commit

Permalink
proper seeding
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Dec 15, 2024
1 parent 1eeab8c commit cd6470a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions backend/onyx/db/persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def upsert_persona(
existing_persona.llm_model_provider_override = llm_model_provider_override
existing_persona.llm_model_version_override = llm_model_version_override
existing_persona.starter_messages = starter_messages
existing_persona.display_priority = display_priority
existing_persona.deleted = False # Un-delete if previously deleted
existing_persona.is_public = is_public
existing_persona.icon_color = icon_color
Expand Down
2 changes: 2 additions & 0 deletions backend/onyx/seeding/load_yamls.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def load_personas_from_yaml(
data = yaml.safe_load(file)

all_personas = data.get("personas", [])

for persona in all_personas:
doc_set_names = persona["document_sets"]
doc_sets: list[DocumentSetDBModel] = [
Expand Down Expand Up @@ -127,6 +128,7 @@ def load_personas_from_yaml(
display_priority=(
existing_persona.display_priority
if existing_persona is not None
and persona.get("display_priority") is None
else persona.get("display_priority")
),
is_visible=(
Expand Down
4 changes: 2 additions & 2 deletions backend/onyx/seeding/personas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ personas:
document_sets: []
icon_shape: 23013
icon_color: "#6FB1FF"
display_priority: 1
display_priority: 0
is_visible: true
starter_messages:
- name: "Give me an overview of what's here"
Expand All @@ -64,7 +64,7 @@ personas:
document_sets: []
icon_shape: 50910
icon_color: "#FF6F6F"
display_priority: 0
display_priority: 1
is_visible: true
starter_messages:
- name: "Summarize a document"
Expand Down
4 changes: 3 additions & 1 deletion web/src/lib/assistants/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ export function getUserCreatedAssistants(
user: User | null,
assistants: Persona[]
) {
return assistants.filter((assistant) =>
const result = assistants.filter((assistant) =>
checkUserOwnsAssistant(user, assistant)
);
console.log("Output - user created assistants:", result);
return result;
}

// Filter assistants based on connector status, image compatibility and visibility
Expand Down

0 comments on commit cd6470a

Please sign in to comment.