Skip to content

Commit

Permalink
fix(docs): add missing steps to run the example and prerequisites (#1083
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gautamgambhir97 authored Dec 5, 2024
1 parent 67e7d7d commit 6074fd8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/spelling/known_words_corpus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -740,3 +740,4 @@ zyx
nlp
CMA
AA
jobsearchagent
30 changes: 27 additions & 3 deletions pages/examples/intermediate/on-query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ This documentation outlines the steps to set up and enable communication between

- [How to use on_query decorator ↗️](../../guides/agents/intermediate/handlers#answer-queries-with-on_query-handler)

## Pre-requisites

- **Python:** Download and install from [Python official website ↗️](https://www.python.org/downloads/).
- **Poetry:** Install by following the instructions on [Poetry's official website ↗️](https://python-poetry.org/docs/#installation).

## Supporting documentation

- [Creating an agent ↗️](/guides/agents/getting-started/create-a-uagent)
Expand Down Expand Up @@ -119,7 +124,13 @@ if __name__ == "__main__":
```
</DocsCode>
</CodeGroup>
Please update agent's secret phrase and serpapi API key. You can find serpapi API key on [SerpAPI API key ↗️](https://serpapi.com/)

<Callout type="info" emoji="ℹ️">
Please update agent's secret phrase and serpapi API key. You can find serpapi API key on [SerpAPI API key ↗️](https://serpapi.com/)
</Callout>




### Flask App Script

Expand Down Expand Up @@ -183,10 +194,23 @@ if __name__ == "__main__":
app.run(debug=True)
```

### Poetry Dependencies

```pyproject.toml copy filename="pyproject.toml"

[tool.poetry.dependencies]
python = ">=3.9,<3.13"
uagents = "^0.17.1"
flask = {extras = ["async"], version = "^3.1.0"}
```

## Steps to run the app

- Navigate to the root folder of the example.
- Install dependencies by running `poetry install`.
- Update `Agent Address` in `jobsearchapp.py` and [`serpapi_api_key`](https://serpapi.com/google-jobs-api) in `JobSearchAgent.py`.
- Run both the script `JobSearchAgent.py` and update the agents address in `jobsearchapp.py`.
- Rerun `JobSearchAgent.py` and `jobsearchapp.py` together
- Run the JobSearchAgent with `python jobSearchAgent.py`
- Run the Flask server with `python jobsearchapp.py`
- Open new terminal window and run `curl "http://127.0.0.1:5000/search-jobs?q=<your_job_serach_query>"`
- Replace `your_job_search_query` with your query in above command.

Expand Down

0 comments on commit 6074fd8

Please sign in to comment.