Skip to content

Commit

Permalink
feat: add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
VinciGit00 committed Jan 2, 2025
1 parent ad3be7f commit ee696d7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pip install llama-index-tools-scrapegraph
First, import and initialize the ScrapegraphToolSpec:

```python
from llama_index.tools.scrapegraph import ScrapegraphToolSpec
from llama_index.tools.scrapegraph.base import ScrapegraphToolSpec

scrapegraph_tool = ScrapegraphToolSpec()
```
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from llama_index.tools.scrapegraph.base import ScrapegraphToolSpec

# Initialize the ScrapegraphToolSpec
scrapegraph_tool = ScrapegraphToolSpec()

# Convert webpage content to markdown
response = scrapegraph_tool.scrapegraph_markdownify(
url="https://scrapegraphai.com/",
api_key="sgai-***" # Replace with your actual API key
)

# Print the markdown content
print("Markdown Content:")
print(response)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import BaseModel, Field
from llama_index.tools.scrapegraph import ScrapegraphToolSpec
from llama_index.tools.scrapegraph.base import ScrapegraphToolSpec

scrapegraph_tool = ScrapegraphToolSpec()

Expand Down

0 comments on commit ee696d7

Please sign in to comment.