Skip to content

Pass the user selection to llm#7598

Open
akatsoulas wants to merge 1 commit into
mozilla:mainfrom
akatsoulas:topic-classifier-hint
Open

Pass the user selection to llm#7598
akatsoulas wants to merge 1 commit into
mozilla:mainfrom
akatsoulas:topic-classifier-hint

Conversation

@akatsoulas

Copy link
Copy Markdown
Collaborator

No description provided.


# Pass the user's form selection as a hint for topic classification.
if submission.category:
zd_topic = ZendeskTopic.objects.filter(slug=submission.category).first()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably worth adding .select_related("topic") to avoid the possible extra query for zd_topic.topic.title below.


# Pass the user's selected topic as a hint for topic classification.
if question.topic_id:
payload["selected_topic"] = question.topic.title

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the case when _handle_product_reassignment is called below, and it, in turn, calls on_reassignment when the product changes, we should probably clear the selected_topic from the payload if it doesn't exist within the new product's taxonomy.

zd_topic = ZendeskTopic.objects.filter(slug=submission.category).first()
if zd_topic:
payload["selected_topic"] = (
zd_topic.topic.title if zd_topic.topic_id else zd_topic.form_title

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think it makes sense to fall back to the form_title when the zd_topic has no associated topic, because if there's no associated topic, doesn't that mean that the form_title doesn't exist in the topic taxonomy or doesn't apply to just a single topic? It seems to me that we should only set selected_topic if the zd_topic has an associated topic, otherwise we should leave it empty.

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.

2 participants