Skip to content

Commit 9f88135

Browse files
committed
Fix pyproject.toml and get hatch run fmt-check to pass
1 parent 5776972 commit 9f88135

File tree

6 files changed

+197
-149
lines changed

6 files changed

+197
-149
lines changed

integrations/watsonx/examples/chat_generator_example.py

Lines changed: 67 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,35 @@ def _run_async(coro_func):
110110
# === Watsonx Chat Generator Demo ===
111111

112112
# --- Basic Chat ---
113-
# Quantum computing is a fascinating technology that uses the principles of quantum mechanics to perform calculations and operations on data. Here's a simple explanation:
113+
# Quantum computing is a fascinating technology that uses the principles of quantum mechanics to perform calculations
114+
# and operations on data. Here's a simple explanation:
114115

115116
# **Classical computers vs. Quantum Computers**
116117

117-
# A classical computer uses "bits" to store and process information. A bit is either 0 or 1, and it's like a light switch - it's either on or off. A quantum computer uses "qubits" (quantum bits), which can exist in multiple states at the same time. This means a quantum computer can process a vast number of possibilities simultaneously.
118+
# A classical computer uses "bits" to store and process information. A bit is either 0 or 1, and it's like a light
119+
# switch - it's either on or off. A quantum computer uses "qubits" (quantum bits), which can exist in multiple states
120+
# at the same time. This means a quantum computer can process a vast number of possibilities simultaneously.
118121

119122
# **How Quantum Computers Work**
120123

121-
# Imagine you have a deck of cards with 52 cards in it. A classical computer would look at each card one by one, and if it finds a match, it would move on to the next card. A quantum computer, on the other hand, can look at all the cards simultaneously and find matches instantly.
124+
# Imagine you have a deck of cards with 52 cards in it. A classical computer would look at each card one by one, and
125+
# if it finds a match, it would move on to the next card. A quantum computer, on the other hand, can look at all the
126+
# cards simultaneously and find matches instantly.
122127

123-
# This is because qubits can exist in multiple states (0, 1, and both at the same time) and can be connected in a way that allows them to communicate with each other instantly, no matter how far apart they are.
128+
# This is because qubits can exist in multiple states (0, 1, and both at the same time) and can be connected in a way
129+
# that allows them to communicate with each other instantly, no matter how far apart they are.
124130

125131
# **Quantum Computing Steps**
126132

127133
# Here's a simplified step-by-step explanation of how a quantum computer works:
128134

129-
# 1. **Qubit Preparation**: The qubits are created and prepared in a special way to represent the problem we want to solve.
130-
# 2. **Quantum Gates**: The qubits are then passed through a series of quantum gates, which are like the "switches" that control the qubits' behavior.
135+
# 1. **Qubit Preparation**: The qubits are created and prepared in a special way to represent the problem we want to
136+
# solve.
137+
# 2. **Quantum Gates**: The qubits are then passed through a series of quantum gates, which are like the "switches"
138+
# that control the qubits' behavior.
131139
# 3. **Quantum Measurement**: The qubits are measured, and the outcome is determined.
132-
# 4. **Data Processing**: The data is processed using the qubits' quantum gates, which allows for fast and efficient calculations.
140+
# 4. **Data Processing**: The data is processed using the qubits' quantum gates, which allows for fast and efficient
141+
# calculations.
133142

134143
# **What Quantum Computers Can Do**
135144

@@ -148,31 +157,44 @@ def _run_async(coro_func):
148157
# * **Scalability**: Currently, quantum computers are not scalable enough to solve complex problems.
149158
# * **Quantum Noise**: Random fluctuations in qubits can affect the accuracy of quantum computations.
150159

151-
# Metadata: {'model': 'meta-llama/llama-3-2-1b-instruct', 'index': 0, 'finish_reason': 'length', 'usage': {'completion_tokens': 500, 'prompt_tokens': 48, 'total_tokens': 548}}
160+
# Metadata: {'model': 'meta-llama/llama-3-2-1b-instruct', 'index': 0, 'finish_reason': 'length', 'usage':
161+
# {'completion_tokens': 500, 'prompt_tokens': 48, 'total_tokens': 548}}
152162

153163
# --- Tool Calling Chat ---
154-
# I'm not aware of any real-time weather information. However, I can suggest some ways for you to find out the current weather in Berlin. You can:
164+
# I'm not aware of any real-time weather information. However, I can suggest some ways for you to find out the current
165+
# weather in Berlin. You can:
155166

156-
# * Check online weather websites such as AccuWeather, Weather.com, or the German national weather service, Deutscher Wetterdienst (DWD).
167+
# * Check online weather websites such as AccuWeather, Weather.com, or the German national weather service, Deutscher
168+
# Wetterdienst (DWD).
157169
# * Use a mobile app such as Dark Sky or Weather Underground.
158170
# * Tune into local news or radio stations for weather updates.
159171

160172
# If you'd like, I can help you find the most up-to-date weather information for Berlin.
161173

162174
# --- Streaming Chat ---
163175

164-
# Full message: I don't have the capability to write poems. However, I can assist you with generating a poem about artificial intelligence if you'd like.
176+
# Full message: I don't have the capability to write poems. However, I can assist you with generating a poem about
177+
# artificial intelligence if you'd like.
165178

166179
# --- Async Chat ---
167180
# Here's an overview of the history of the internet:
168181

169-
# * **Early beginnings:** The internet has its roots in the 1960s, when the United States Department of Defense's Advanced Research Projects Agency (ARPA) funded a project to create a network of computers that could communicate with each other. This project, called ARPANET, was the first operational packet switching network.
170-
# * **Network expansion:** In the 1970s and 1980s, other networks, such as the National Science Foundation Network (NSFNET), were established, connecting universities and research institutions across the United States.
171-
# * **The World Wide Web (WWW):** In 1989, Tim Berners-Lee invented the World Wide Web, which revolutionized the way people access and share information online. The web made it easy for users to navigate and access information using web browsers and hyperlinks.
172-
# * **Internet growth:** The 1990s saw the rise of commercial internet services, such as America Online (AOL) and CompuServe. This led to the growth of the internet as a mainstream technology.
173-
# * **Globalization:** The internet became increasingly global, with the establishment of international networks and the development of new technologies, such as broadband and mobile internet.
174-
# * **Social media and online communities:** The 2000s saw the rise of social media platforms, such as Facebook and Twitter, which enabled people to connect with each other and share information online.
175-
# * **The internet today:** The internet is now a global network of billions of interconnected devices, with applications ranging from online shopping and education to social media and entertainment.
182+
# * **Early beginnings:** The internet has its roots in the 1960s, when the United States Department of Defense's
183+
# Advanced Research Projects Agency (ARPA) funded a project to create a network of computers that could
184+
# communicate with each other. This project, called ARPANET, was the first operational packet switching network.
185+
# * **Network expansion:** In the 1970s and 1980s, other networks, such as the National Science Foundation Network
186+
# (NSFNET), were established, connecting universities and research institutions across the United States.
187+
# * **The World Wide Web (WWW):** In 1989, Tim Berners-Lee invented the World Wide Web, which revolutionized the
188+
# way people access and share information online. The web made it easy for users to navigate and access
189+
# information using web browsers and hyperlinks.
190+
# * **Internet growth:** The 1990s saw the rise of commercial internet services, such as America Online (AOL) and
191+
# CompuServe. This led to the growth of the internet as a mainstream technology.
192+
# * **Globalization:** The internet became increasingly global, with the establishment of international networks
193+
# and the development of new technologies, such as broadband and mobile internet.
194+
# * **Social media and online communities:** The 2000s saw the rise of social media platforms, such as Facebook
195+
# and Twitter, which enabled people to connect with each other and share information online.
196+
# * **The internet today:** The internet is now a global network of billions of interconnected devices, with
197+
# applications ranging from online shopping and education to social media and entertainment.
176198

177199
# Here's a summary of the key events and milestones in the history of the internet:
178200

@@ -183,36 +205,50 @@ def _run_async(coro_func):
183205
# * 1995: Broadband internet becomes available
184206
# * 2000: Social media platforms begin to emerge
185207
# * 2007: Facebook becomes one of the most popular social media platforms
186-
# * 2010s: The internet continues to evolve with the development of new technologies, such as mobile internet and artificial intelligence.
208+
# * 2010s: The internet continues to evolve with the development of new technologies, such as mobile internet and
209+
# artificial intelligence.
187210

188211
# --- Async Streaming Chat ---
189212

190213
# Full message: **Tool Call: Blockchain Technology**
191214

192-
# The tool call "Blockchain Technology" is a fundamental concept in the field of cryptography and distributed ledger technology. Here's a brief explanation:
215+
# The tool call "Blockchain Technology" is a fundamental concept in the field of cryptography and distributed ledger
216+
# technology. Here's a brief explanation:
193217

194-
# Blockchain technology is a decentralized, digital ledger that records transactions across a network of computers in a secure and transparent manner. It allows for the creation of a permanent, immutable record of all transactions, making it ideal for applications such as cryptocurrency, supply chain management, and voting systems.
218+
# Blockchain technology is a decentralized, digital ledger that records transactions across a network of computers in
219+
# a secure and transparent manner. It allows for the creation of a permanent, immutable record of all transactions,
220+
# making it ideal for applications such as cryptocurrency, supply chain management, and voting systems.
195221

196222
# Here's a high-level overview of how blockchain technology works:
197223

198-
# 1. **Distributed Ledger**: A blockchain is a distributed ledger that is maintained by a network of computers (nodes) that are connected to each other through a peer-to-peer network.
199-
# 2. **Transactions**: When a user wants to make a transaction, they create a new entry in the blockchain by broadcasting the transaction to the network of nodes.
200-
# 3. **Verification**: Each node verifies the transaction by checking its validity and ensuring that it is not tampered with.
224+
# 1. **Distributed Ledger**: A blockchain is a distributed ledger that is maintained by a network of computers
225+
# (nodes) that are connected to each other through a peer-to-peer network.
226+
# 2. **Transactions**: When a user wants to make a transaction, they create a new entry in the blockchain by
227+
# broadcasting the transaction to the network of nodes.
228+
# 3. **Verification**: Each node verifies the transaction by checking its validity and ensuring that it is not
229+
# tampered with.
201230
# 4. **Block Creation**: Once a node verifies the transaction, it creates a new block and adds it to the blockchain.
202-
# 5. **Blockchain Update**: Each node updates its copy of the blockchain with the new block, ensuring that all nodes have the same version of the blockchain.
231+
# 5. **Blockchain Update**: Each node updates its copy of the blockchain with the new block, ensuring that all nodes
232+
# have the same version of the blockchain.
203233

204234
# **Benefits of Blockchain Technology**
205235

206-
# 1. **Security**: Blockchain technology is secure due to the use of cryptography and the decentralized nature of the network.
236+
# 1. **Security**: Blockchain technology is secure due to the use of cryptography and the decentralized nature of
237+
# the network.
207238
# 2. **Transparency**: All transactions are recorded in a public ledger, making it transparent and tamper-proof.
208-
# 3. **Immutable**: The blockchain is an immutable record, meaning that once a transaction is recorded, it cannot be altered or deleted.
209-
# 4. **Decentralization**: Blockchain technology is decentralized, meaning that there is no single point of control or authority.
239+
# 3. **Immutable**: The blockchain is an immutable record, meaning that once a transaction is recorded, it cannot
240+
# be altered or deleted.
241+
# 4. **Decentralization**: Blockchain technology is decentralized, meaning that there is no single point of control
242+
# or authority.
210243

211244
# **Real-World Applications of Blockchain Technology**
212245

213246
# 1. **Cryptocurrencies**: Blockchain technology is the foundation for cryptocurrencies such as Bitcoin and Ethereum.
214-
# 2. **Supply Chain Management**: Blockchain technology is being used to track the movement of goods and materials throughout the supply chain.
247+
# 2. **Supply Chain Management**: Blockchain technology is being used to track the movement of goods and materials
248+
# throughout the supply chain.
215249
# 3. **Voting Systems**: Blockchain technology is being used to create secure and transparent voting systems.
216-
# 4. **Identity Verification**: Blockchain technology is being used to create secure and decentralized identity verification systems.
250+
# 4. **Identity Verification**: Blockchain technology is being used to create secure and decentralized identity
251+
# verification systems.
217252

218-
# In summary, blockchain technology is a decentralized, digital ledger that records transactions in a secure and transparent manner. Its benefits include security, transparency, immutability, and decentralization.
253+
# In summary, blockchain technology is a decentralized, digital ledger that records transactions in a secure and
254+
# transparent manner. Its benefits include security, transparency, immutability, and decentralization.

integrations/watsonx/examples/embedders_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@
5353
# Step 7: Print result
5454

5555
### Result
56-
# Document(id=62fad790ad2af927af9432c87330ed2ea5e31332cdec8e9d6235a5105ab0aaf5, content: 'My name is Wolfgang and I live in Berlin', score: 0.7287276769333577)
56+
# Document(id=62fad790ad2af927af9432c87330ed2ea5e31332cdec8e9d6235a5105ab0aaf5, content: 'My name is Wolfgang and I
57+
# live in Berlin', score: 0.7287276769333577)

integrations/watsonx/examples/generator_example.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,7 @@
5050

5151

5252
##Result for steaming generator
53-
##Full response: The AI assistant is a friendly and helpful robot that can help you with many tasks, such as setting reminders,
54-
## managing your calendar, and creating to-do lists. You can also use the AI assistant to search for information online, or just have fun conversations with it.
53+
##Full response: The AI assistant is a friendly and helpful robot that can help you with many tasks, such as setting
54+
# reminders,
55+
## managing your calendar, and creating to-do lists. You can also use the AI assistant to search for information
56+
# online, or just have fun conversations with it.

0 commit comments

Comments
 (0)