feature: usage documentation
Browse files- app/main.py +15 -0
app/main.py
CHANGED
@@ -34,6 +34,21 @@ async def ask_question(question: str, context: str):
|
|
34 |
Returns:
|
35 |
A JSON object with the 'answer' field containing the response from
|
36 |
the chatbot.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
"""
|
38 |
result = question_answerer(question=question, context=context)
|
39 |
return {'answer': result['answer']}
|
|
|
34 |
Returns:
|
35 |
A JSON object with the 'answer' field containing the response from
|
36 |
the chatbot.
|
37 |
+
|
38 |
+
Example:
|
39 |
+
|
40 |
+
1. Go to the Swagger UI.
|
41 |
+
2. Scroll down to the /chatbot POST method section.
|
42 |
+
3. Click on the Try it out button.
|
43 |
+
4. In the question field, enter: "What is the capital of France?"
|
44 |
+
5. In the context field, enter: "France is a country in Western
|
45 |
+
Europe. It has several beautiful cities, including Paris, which
|
46 |
+
is its capital. France is known for its wine, sophisticated
|
47 |
+
cuisine, and landmarks like the Eiffel Tower."
|
48 |
+
6. Click the Execute button to submit the request.
|
49 |
+
7. Scroll down to see the server response, where you will find the
|
50 |
+
answer.
|
51 |
+
|
52 |
"""
|
53 |
result = question_answerer(question=question, context=context)
|
54 |
return {'answer': result['answer']}
|