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

LAB02 Q&A: The "quit" command in the clients (both C# and Python) doesn't exit immediately #59

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
8 changes: 6 additions & 2 deletions Instructions/Exercises/02-qna.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,12 @@ Now you're ready to add the code necessary to import the required SDK libraries,
```C#
// Submit a question and display the answer
string user_question = "";
while (user_question.ToLower() != "quit")
while (true)
{
Console.Write("Question: ");
user_question = Console.ReadLine();
if (user_question.ToLower() == "quit")
break;
QuestionAnsweringProject project = new QuestionAnsweringProject(projectName, deploymentName);
Response<AnswersResult> response = aiClient.GetAnswers(user_question, project);
foreach (KnowledgeBaseAnswer answer in response.Value.Answers)
Expand All @@ -233,8 +235,10 @@ Now you're ready to add the code necessary to import the required SDK libraries,
```Python
# Submit a question and display the answer
user_question = ''
while user_question.lower() != 'quit':
while True:
user_question = input('\nQuestion:\n')
if user_question.lower() == "quit":
break
response = ai_client.get_answers(question=user_question,
project_name=ai_project_name,
deployment_name=ai_deployment_name)
Expand Down