forked from phidatahq/phidata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d8ca2a
commit d734646
Showing
13 changed files
with
290 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,44 @@ | ||
from textwrap import dedent | ||
|
||
from phi.assistant import Assistant | ||
from phi.tools.duckduckgo import DuckDuckGo | ||
from phi.tools.newspaper4k import Newspaper4k | ||
|
||
assistant = Assistant( | ||
tools=[DuckDuckGo(), Newspaper4k()], | ||
show_tool_calls=True, | ||
description="You are a senior NYT researcher writing an article on a topic.", | ||
instructions=[ | ||
"For the provided topic, search for the top 3 links.", | ||
"For the provided topic, search for the top 5 links.", | ||
"Then read each URL and extract the article text. If a URL isn't available, ignore and move on.", | ||
"Analyse and prepare an NYT worthy article based on the information.", | ||
], | ||
add_datetime_to_instructions=True, | ||
expected_output=dedent("""\ | ||
An engaging, informative, and well-structured article in the following format: | ||
<article_format> | ||
## Engaging Article Title | ||
### Overview | ||
{give a brief introduction of the article and why the user should read this report} | ||
{make this section engaging and create a hook for the reader} | ||
### Section 1 | ||
{break the article into sections} | ||
{provide details/facts/processes in this section} | ||
... more sections as necessary... | ||
### Takeaways | ||
{provide key takeaways from the article} | ||
### References | ||
- [Title](url) | ||
- [Title](url) | ||
- [Title](url) | ||
</article_format>\ | ||
"""), | ||
# show_tool_calls=True, | ||
debug_mode=True, | ||
save_output_to_file="news_article.md", | ||
) | ||
assistant.print_response("Latest developments in AI", markdown=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
from phi.assistant import Assistant | ||
from phi.tools.duckduckgo import DuckDuckGo | ||
|
||
assistant = Assistant(tools=[DuckDuckGo()], show_tool_calls=True, monitoring=True, debug_mode=True) | ||
assistant.print_response("Share 1 story from France?", markdown=True) | ||
assistant.print_response("Share 1 story from UK?", markdown=True) | ||
assistant = Assistant(tools=[DuckDuckGo()], show_tool_calls=True, markdown=True) | ||
assistant.print_response("Share 1 story from France?") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
""" | ||
Please install dependencies using: | ||
pip install openai duckduckgo-search newspaper4k lxml_html_clean phidata | ||
""" | ||
|
||
from shutil import rmtree | ||
from pathlib import Path | ||
from textwrap import dedent | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel, Field | ||
from phi.assistant import Assistant | ||
from phi.workflow import Workflow, Task | ||
from phi.tools.duckduckgo import DuckDuckGo | ||
from phi.tools.newspaper4k import Newspaper4k | ||
|
||
|
||
articles_dir = Path(__file__).parent.parent.parent.joinpath("wip", "articles") | ||
if articles_dir.exists(): | ||
rmtree(path=articles_dir, ignore_errors=True) | ||
articles_dir.mkdir(parents=True, exist_ok=True) | ||
|
||
|
||
class NewsArticle(BaseModel): | ||
title: str = Field(..., description="Title of the article.") | ||
url: str = Field(..., description="Link to the article.") | ||
summary: Optional[str] = Field(..., description="Summary of the article if available.") | ||
|
||
|
||
researcher = Assistant( | ||
name="Article Researcher", | ||
tools=[DuckDuckGo()], | ||
description="Given a topic, search for 15 articles and return the 7 most relevant articles.", | ||
output_model=NewsArticle, | ||
) | ||
|
||
writer = Assistant( | ||
name="Article Writer", | ||
tools=[Newspaper4k()], | ||
description="You are a Senior NYT Editor and your task is to write a NYT cover story worthy article due tomorrow.", | ||
instructions=[ | ||
"You will be provided with news articles and their links.", | ||
"Carefully read each article and think about the contents", | ||
"Then generate a final New York Times worthy article in the <article_format> provided below.", | ||
"Break the article into sections and provide key takeaways at the end.", | ||
"Make sure the title is catchy and engaging.", | ||
"Give the section relevant titles and provide details/facts/processes in each section." | ||
"Ignore articles that you cannot read or understand.", | ||
"REMEMBER: you are writing for the New York Times, so the quality of the article is important.", | ||
], | ||
expected_output=dedent("""\ | ||
An engaging, informative, and well-structured article in the following format: | ||
<article_format> | ||
## Engaging Article Title | ||
### Overview | ||
{give a brief introduction of the article and why the user should read this report} | ||
{make this section engaging and create a hook for the reader} | ||
### Section 1 | ||
{break the article into sections} | ||
{provide details/facts/processes in this section} | ||
... more sections as necessary... | ||
### Takeaways | ||
{provide key takeaways from the article} | ||
### References | ||
- [Title](url) | ||
- [Title](url) | ||
- [Title](url) | ||
</article_format> | ||
"""), | ||
) | ||
|
||
news_article = Workflow( | ||
name="News Article Workflow", | ||
tasks=[ | ||
Task( | ||
description="Find the 7 most relevant articles on a topic.", | ||
assistant=researcher, | ||
show_output=False, | ||
), | ||
Task( | ||
description="Read each article and and write a NYT worthy news article.", | ||
assistant=writer, | ||
), | ||
], | ||
debug_mode=True, | ||
save_output_to_file="news_article.md", | ||
) | ||
|
||
news_article.print_response( | ||
"Hashicorp IBM acquisition", | ||
markdown=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
## IBM Acquires HashiCorp: A Game-Changer in Hybrid Cloud Platform Innovation | ||
|
||
### Overview | ||
In a landmark transaction, IBM has officially announced its acquisition of HashiCorp Inc. for an impressive $6.4 billion, cashing in at $35 per share. This strategic move is set to redefine the contours of the hybrid cloud market, integrating HashiCorp's robust capabilities in multi-cloud infrastructure automation with IBM's expansive technology ecosystem. This article delves into the strategic imperatives of the acquisition and its potential to revolutionize the industry by fostering an integrated hybrid cloud platform optimized for the AI era. | ||
|
||
### Genesis of a Tech Giant Collaboration | ||
Arvind Krishna, IBM's Chairman and CEO, emphasized that the acquisition is a strategic response to the escalating complexity within enterprise IT environments, exacerbated by the rapid proliferation of multi-cloud and hybrid infrastructures and the generative AI revolution. HashiCorp, renowned for its pioneering products like Terraform and Vault, provides critical tools that enable effective lifecycle management across diverse cloud environments. This acquisition is not just a merger of technologies but a confluence of visions aimed at simplifying the inherent complexities of modern IT infrastructure. | ||
|
||
### Enhancing Hybrid Cloud Capabilities | ||
The fusion of IBM and HashiCorp promises extensive enhancements to hybrid cloud capabilities. For instance, HashiCorp's Terraform complements IBM’s existing enterprise solutions, potentially transforming infrastructure management by providing a unified workflow for provisioning both cloud-based and on-premises resources. IBM's strategy appears twofold: to deepen its cloud management prowess while simultaneously advancing its stake in the burgeoning AI-centric market, which is increasingly reliant on diverse and scalable cloud infrastructures. | ||
|
||
### Strategic Synergies and Financial Prospects | ||
The deal is strategically aligned with IBM’s ongoing investment in hybrid cloud and AI technologies, areas identified by the tech giant as crucial for its future growth. Financially, the acquisition is poised to be immediately accretive to IBM’s adjusted EBITDA post-closing, with expected substantial margin expansion due to synergistic efficiencies between the two companies' offerings. Moreover, HashiCorp’s strong customer base, including industry giants like Bloomberg and Vodafone, combined with its impressive revenue growth, positions IBM to potentially enhance its market share and financial performance in the cloud sector. | ||
|
||
### Future Outlook and Integration Strategy | ||
Looking forward, the integration strategy centers around maintaining HashiCorp’s brand and operational independence within IBM’s larger framework. This approach is intended to preserve HashiCorp’s innovative culture and core values while leveraging IBM's extensive market reach and industrial expertise. The overarching goal is to create a holistic platform that not only aligns with but also propels the current and future requirements of hybrid cloud and AI applications across various industries. | ||
|
||
### Takeaways | ||
- The acquisition of HashiCorp by IBM for $6.4 billion marks a significant enhancement of IBM's capabilities in hybrid cloud and automation technologies. | ||
- HashiCorp’s strengths in multi-cloud infrastructure automation are a strategic fit within IBM’s broader technology and business strategy. | ||
- Financially, the acquisition is expected to contribute positively to IBM's profitability metrics and market positioning in the hybrid cloud space. | ||
- The strategic integration of IBM and HashiCorp's technologies aims to create a comprehensive end-to-end platform that addresses the dynamic and complex nature of modern digital infrastructures. | ||
|
||
### References | ||
- [IBM to Acquire HashiCorp, Inc. Creating a Comprehensive End-to-End Hybrid Cloud Platform](https://newsroom.ibm.com/2024-04-24-IBM-to-Acquire-HashiCorp-Inc-Creating-a-Comprehensive-End-to-End-Hybrid-Cloud-Platform) | ||
- [IBM moves deeper into hybrid cloud management with $6.4B HashiCorp acquisition](https://techcrunch.com/2024/04/24/ibm-moves-deeper-into-hybrid-cloud-management-with-6-4b-hashicorp-acquisition/) | ||
- [IBM Acquires HashiCorp for $6.4 Billion, Expanding Hybrid Cloud Offerings](https://www.techrepublic.com/article/ibm-hashicorp-acquisition/) |
Oops, something went wrong.