# Jokes Process Flow

## Identify the Jokes Category

Jokes category is identified based on the User Request, Jokes are currently spoken by Aryan in English language only

* If the user request is for "geeky/nerdy" jokes then the category is neutral
* If the user request is for "Chuck Norris" jokes then the category is chuck
* In case of no specific user request or neither of this categories then the category is defaulted as "all"

## Get the Jokes

Python **pyjokes** package is used to get the Jokes based on Language and category.

{% hint style="info" %}
[pyjokes ](https://pypi.org/project/pyjokes/)packages is used for one line jokes for programmers (jokes as a service)
{% endhint %}

* **Get Jokes for category as neutral**

```python
My_joke = pyjokes.get_joke(language="en", category="neutral")
PrintText(aifriend,"Geeky Joke for you is: " + My_joke)
SpeakText(aifriend,"Geeky Joke for you is: " + My_joke)
```

* **Get Jokes for category as neutral**

```python
My_joke = pyjokes.get_joke(language="en", category="chuck")
PrintText(aifriend,"Chuck Norris Joke for you is: " + My_joke)
SpeakText(aifriend,"Chuck Norris Joke for you is: " + My_joke)     
```

* **Get Jokes for category as ALL**

```python
My_joke = pyjokes.get_joke(language="en", category="all")
PrintText(aifriend,"Joke for you is: " + My_joke)
SpeakText(aifriend,"Joke for you is: " + My_joke)
```

{% hint style="success" %}
Respective jokes are provided to user and thereafter control is returned to NextStep
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aryanai.gitbook.io/docs.aryanandarya/my-skills/can-you-tell-me-chuck-norris-jokes/process-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
