Skip to content

Commit

Permalink
added smolagents example
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf committed Dec 30, 2024
1 parent 6df9cc8 commit 9a9be64
Show file tree
Hide file tree
Showing 5 changed files with 669 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/00_setup/environment-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ dependencies:
- llama-index-embeddings-huggingface
- tokenizers==0.21.0
- pypdf
- smolagents==0.1.3
prefix: C:\Users\haase\miniconda3\envs\genai-cpu
1 change: 1 addition & 0 deletions docs/00_setup/environment-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ dependencies:
- llama-index-embeddings-huggingface
- tokenizers==0.21.0
- pypdf
- smolagents==0.1.3
prefix: C:\Users\haase\miniconda3\envs\genai-gpu
22 changes: 21 additions & 1 deletion docs/35_agents/agent_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,24 @@ def print_messages(message_list):
elif isinstance(c, autogen_core.models._types.FunctionExecutionResult):
display(Markdown(f" = {c.content}\n\n"))
else:
display(Markdown(f"'{c}' \n\n"))
display(Markdown(f"'{c}' \n\n"))



def get_arxiv_metadata(arxiv_id):
import arxiv
search = arxiv.Search(id_list=[arxiv_id])
paper = next(search.results())

metadata = {
'title': paper.title,
'authors': [author.name for author in paper.authors],
'published': paper.published,
'summary': paper.summary,
'doi': paper.doi,
'primary_category': paper.primary_category,
'categories': paper.categories,
'pdf_url': paper.pdf_url
}
return metadata

Loading

0 comments on commit 9a9be64

Please sign in to comment.