Skip to content

Commit f735b47

Browse files
committed
teste
1 parent c19e444 commit f735b47

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

docs/blog/posts/test.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors:
66
categories:
77
- welcome
88
tags:
9-
- Foo
9+
- Fooi
1010
- Bar
1111
draft: true
1212

@@ -41,7 +41,7 @@ You have two main options:
4141

4242
LLMs are a key component of AI Agents, providing the foundation for understanding and generating human language.
4343

44-
## System Messages: The Underlying System of LLMs
44+
## System Messages: The Underlying System of LLMs
4545

4646
System messages (also called System Prompts) define how the model should behave. They serve as persistent instructions, guiding every subsequent interaction.
4747

@@ -53,6 +53,7 @@ system_message = {
5353
"content": "You are a professional customer service agent. Always be polite, clear, and helpful."
5454
}
5555
```
56+
5657
When using Agents, the System Message also gives information about the available tools, provides instructions to the model on how to format the actions to take, and includes guidelines on how the thought process should be segmented.
5758

5859
## Conversations: User and Assistant Messages
@@ -115,18 +116,18 @@ rendered_prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_ge
115116

116117
This <code>apply_chat_template()</code> function will be used in the backend of your API, when you interact with messages in the ChatML format.
117118

118-
# What are Tools?
119+
# What are Tools?
119120

120121
One crucial aspect of AI Agents is their ability to take actions. As we saw, this happens through the use of Tools.
121122

122123
A Tool is a function given to the LLM. This function should fulfill a clear objective.
123124

124-
|Tool |Description|
125-
| -------- | ------- |
126-
|Web Search |Allows the agent to fetch up-to-date information from the internet.|
127-
|Image Generation |Creates images based on text descriptions.|
128-
|Retrieval |Retrieves information from an external source.|
129-
|API Interface |Interacts with an external API (GitHub, YouTube, Spotify, etc.).|
125+
| Tool | Description |
126+
| ---------------- | ------------------------------------------------------------------- |
127+
| Web Search | Allows the agent to fetch up-to-date information from the internet. |
128+
| Image Generation | Creates images based on text descriptions. |
129+
| Retrieval | Retrieves information from an external source. |
130+
| API Interface | Interacts with an external API (GitHub, YouTube, Spotify, etc.). |
130131

131132
A good tool should be something that complements the power of an LLM.
132133

@@ -198,13 +199,13 @@ Tool Name: calculator, Description: Multiply two integers., Arguments: a: int, b
198199

199200
As you can see, it’s the same thing we wrote manually before!
200201

201-
## Generic Tool implementation
202+
## Generic Tool implementation
202203

203204
```python
204205
class Tool:
205206
"""
206207
A class representing a reusable piece of code (Tool).
207-
208+
208209
Attributes:
209210
name (str): Name of the tool.
210211
description (str): A textual description of what the tool does.
@@ -232,7 +233,7 @@ class Tool:
232233
args_str = ", ".join([
233234
f"{arg_name}: {arg_type}" for arg_name, arg_type in self.arguments
234235
])
235-
236+
236237
return (
237238
f"Tool Name: {self.name},"
238239
f" Description: {self.description},"
@@ -278,7 +279,7 @@ def tool(func):
278279
"""
279280
# Get the function signature
280281
signature = inspect.signature(func)
281-
282+
282283
# Extract (param_name, param_annotation) pairs for inputs
283284
arguments = []
284285
for param in signature.parameters.values():
@@ -288,7 +289,7 @@ def tool(func):
288289
else str(param.annotation)
289290
)
290291
arguments.append((param.name, annotation_name))
291-
292+
292293
# Determine the return annotation
293294
return_annotation = signature.return_annotation
294295
if return_annotation is inspect._empty:
@@ -299,13 +300,13 @@ def tool(func):
299300
if hasattr(return_annotation, '__name__')
300301
else str(return_annotation)
301302
)
302-
303+
303304
# Use the function's docstring as the description (default if None)
304305
description = func.__doc__ or "No description provided."
305-
306+
306307
# The function name becomes the Tool name
307308
name = func.__name__
308-
309+
309310
# Return a new Tool instance
310311
return Tool(
311312
name=name,

0 commit comments

Comments
 (0)