Skip to content

Commit 2e77de6

Browse files
authored
book diagrams: OllamaLLM UML class diagram (#202)
* ollama llm uml * add params to init
1 parent e35f5ab commit 2e77de6

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

uml/ch03/llm_class.puml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package "llm_agents_from_scratch.data_structures.llm" <<Folder>> {
3030
}
3131
}
3232

33-
' BaseTool
33+
' BaseLLM
3434
package "llm_agents_from_scratch.base.llm" <<Folder>> {
3535
abstract class BaseLLM {
3636
--

uml/ch03/ollama_llm.puml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@startuml ollama_llm_class
2+
!include ../common/book-clean.puml
3+
4+
5+
package "llm_agents_from_scratch.base.llm" <<Folder>> {
6+
abstract class BaseLLM {
7+
--
8+
+<<async>> complete(\n\tprompt: str\n): CompleteResult\n
9+
+<<async>> chat(\n\tinput: str,\n\tchat_history: list[ChatMessage],\n\ttools: list[BaseTool | AsyncBaseTool]\n): tuple[ChatMessage, ChatMessage]\n
10+
+<<async>> continue_chat_with_tool_results(\n\ttool_call_results: list[ToolCallResult],\n\tchat_history: list[ChatMessage]\n): tuple[list[ChatMessage], ChatMessage]\n
11+
+<<async>> structured_output<T>(\n\tprompt:str,\n\tmdl: type[T]\n): T
12+
}
13+
}
14+
15+
package "llm_agents_from_scratch.llms" <<Folder>> {
16+
17+
class OllamaLLM {
18+
+model: str
19+
-_client: ~ollama.AsyncClient
20+
--
21+
+<<constructor>> __init__(\n\tmodel:str,\n\thost: str | None\n):
22+
}
23+
}
24+
25+
' Relations
26+
BaseLLM <|-- OllamaLLM : " inherits"
27+
28+
@enduml

0 commit comments

Comments
 (0)