Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant update query sample_id without having duplicate sample in 2 tasks #572

Open
navid-farjad opened this issue Oct 8, 2021 · 3 comments
Labels
type: non-library issue API issue not solvable via the SDK

Comments

@navid-farjad
Copy link

Issue Summary

in query object we have sample_id. if someone wants to update this sample id then there is no way to remove the old sample_id from its task as we don't have a task_id in the query object!

Steps to Reproduce

  1. update sample_id to the query (create sample_1 with tagged_text for task_1 and add sample_1 to query)
  2. update sample_id to the query (create sample_2 with tagged_text for task_2 and add sample_2 to query)
  3. now both task_1 and task_2 have the same tagged_text! and from here you can not delete sample_2 as you don't have task_id in the query object!

if there is a way to get sample object from API without task_id this issue is solved but I can see only one way to get it with task_id:

client.autopilot.assistants(company.ai_assistant.assistant_id)
.tasks(task_id)
.samples(id)
.fetch

Technical details:

  • twilio-ruby version: 5.59.0
  • ruby version: 2.7.2
@navid-farjad
Copy link
Author

if samples need task_id to be fetched then you should include task_id in any response object that has sample_id!

@shwetha-manvinkurke
Copy link
Contributor

shwetha-manvinkurke commented Oct 27, 2021

Hi @navid-farjad I am not following what this query object is that you are talking about. Can you explain your use case better? Also, you cannot get a sample resource without a task id since the sample resource belongs to a task. Moreover, this is not a helper library specific issue but we can get in touch with the API team if there's a need.

@shwetha-manvinkurke shwetha-manvinkurke added status: waiting for feedback waiting for feedback from the submitter type: non-library issue API issue not solvable via the SDK and removed status: waiting for feedback waiting for feedback from the submitter labels Oct 27, 2021
@navid-farjad
Copy link
Author

navid-farjad commented Nov 15, 2021

Hello @shwetha-manvinkurke , thank you for your respond, here is the example:

  1. I am assigning "Bye" to "no_emergency" task
    Screenshot from 2021-11-15 13-38-43

  2. I am assigning "Bye" to "emergency" task
    Screenshot from 2021-11-15 13-39-55

  3. now both "no_emergency" and "emergency" tasks have "Bye" assigned to them!

Screenshot from 2021-11-15 13-40-30
Screenshot from 2021-11-15 13-40-43

If sample resource belongs to a task then I assume in your DB you have task_id in the sample object! so with sample_id, I can find the step 1 sample object and delete it!
otherwise, the logic is wrong!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: non-library issue API issue not solvable via the SDK
Projects
None yet
Development

No branches or pull requests

2 participants