agentica 0.1.5__tar.gz → 0.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. {agentica-0.1.5 → agentica-0.1.6}/PKG-INFO +3 -3
  2. {agentica-0.1.5 → agentica-0.1.6}/README.md +2 -2
  3. {agentica-0.1.5 → agentica-0.1.6}/agentica/__init__.py +15 -14
  4. {agentica-0.1.5 → agentica-0.1.6}/agentica/assistant.py +2 -2
  5. agentica-0.1.5/agentica/emb/fireworks.py → agentica-0.1.6/agentica/emb/fireworks_emb.py +1 -1
  6. agentica-0.1.5/agentica/emb/huggingface.py → agentica-0.1.6/agentica/emb/huggingface_emb.py +4 -4
  7. agentica-0.1.5/agentica/emb/ollama.py → agentica-0.1.6/agentica/emb/ollama_emb.py +8 -9
  8. agentica-0.1.5/agentica/emb/together.py → agentica-0.1.6/agentica/emb/together_emb.py +1 -1
  9. {agentica-0.1.5 → agentica-0.1.6}/agentica/llm/__init__.py +2 -2
  10. agentica-0.1.5/agentica/llm/azure_openai.py → agentica-0.1.6/agentica/llm/azure_openai_llm.py +3 -3
  11. agentica-0.1.5/agentica/llm/claude.py → agentica-0.1.6/agentica/llm/claude_llm.py +2 -2
  12. agentica-0.1.5/agentica/llm/deepseek.py → agentica-0.1.6/agentica/llm/deepseek_llm.py +3 -3
  13. agentica-0.1.5/agentica/llm/moonshot.py → agentica-0.1.6/agentica/llm/moonshot_llm.py +3 -3
  14. agentica-0.1.5/agentica/llm/ollama_chat.py → agentica-0.1.6/agentica/llm/ollama_llm.py +1 -1
  15. agentica-0.1.5/agentica/llm/ollama_tools.py → agentica-0.1.6/agentica/llm/ollama_tools_llm.py +1 -1
  16. agentica-0.1.5/agentica/llm/openai_chat.py → agentica-0.1.6/agentica/llm/openai_llm.py +2 -2
  17. agentica-0.1.5/agentica/llm/together.py → agentica-0.1.6/agentica/llm/togetherllm.py +2 -2
  18. {agentica-0.1.5 → agentica-0.1.6}/agentica/memory.py +3 -3
  19. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/analyze_image.py +2 -2
  20. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/create_image.py +2 -2
  21. {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/chromadb.py +1 -1
  22. {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/lancedb.py +1 -1
  23. {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/memory_vectordb.py +1 -1
  24. {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/pgvector.py +1 -1
  25. {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/pineconedb.py +1 -1
  26. {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/qdrant.py +1 -1
  27. agentica-0.1.6/agentica/version.py +1 -0
  28. {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/PKG-INFO +3 -3
  29. {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/SOURCES.txt +18 -18
  30. {agentica-0.1.5 → agentica-0.1.6}/tests/test_llm.py +0 -3
  31. agentica-0.1.5/agentica/version.py +0 -1
  32. {agentica-0.1.5 → agentica-0.1.6}/LICENSE +0 -0
  33. {agentica-0.1.5 → agentica-0.1.6}/agentica/config.py +0 -0
  34. {agentica-0.1.5 → agentica-0.1.6}/agentica/document.py +0 -0
  35. {agentica-0.1.5 → agentica-0.1.6}/agentica/emb/__init__.py +0 -0
  36. /agentica-0.1.5/agentica/emb/azure_openai.py → /agentica-0.1.6/agentica/emb/azure_openai_emb.py +0 -0
  37. {agentica-0.1.5 → agentica-0.1.6}/agentica/emb/base.py +0 -0
  38. /agentica-0.1.5/agentica/emb/genimi.py → /agentica-0.1.6/agentica/emb/genimi_emb.py +0 -0
  39. {agentica-0.1.5 → agentica-0.1.6}/agentica/emb/hash_emb.py +0 -0
  40. /agentica-0.1.5/agentica/emb/openai.py → /agentica-0.1.6/agentica/emb/openai_emb.py +0 -0
  41. /agentica-0.1.5/agentica/emb/sentence_transformer.py → /agentica-0.1.6/agentica/emb/sentence_transformer_emb.py +0 -0
  42. /agentica-0.1.5/agentica/emb/text2vec.py → /agentica-0.1.6/agentica/emb/text2vec_emb.py +0 -0
  43. /agentica-0.1.5/agentica/emb/word2vec.py → /agentica-0.1.6/agentica/emb/word2vec_emb.py +0 -0
  44. {agentica-0.1.5 → agentica-0.1.6}/agentica/file/__init__.py +0 -0
  45. {agentica-0.1.5 → agentica-0.1.6}/agentica/file/base.py +0 -0
  46. {agentica-0.1.5 → agentica-0.1.6}/agentica/file/csv.py +0 -0
  47. {agentica-0.1.5 → agentica-0.1.6}/agentica/file/txt.py +0 -0
  48. {agentica-0.1.5 → agentica-0.1.6}/agentica/knowledge/__init__.py +0 -0
  49. {agentica-0.1.5 → agentica-0.1.6}/agentica/knowledge/knowledge_base.py +0 -0
  50. {agentica-0.1.5 → agentica-0.1.6}/agentica/knowledge/langchain.py +0 -0
  51. {agentica-0.1.5 → agentica-0.1.6}/agentica/knowledge/llamaindex.py +0 -0
  52. {agentica-0.1.5 → agentica-0.1.6}/agentica/llm/base.py +0 -0
  53. {agentica-0.1.5 → agentica-0.1.6}/agentica/message.py +0 -0
  54. {agentica-0.1.5 → agentica-0.1.6}/agentica/python_assistant.py +0 -0
  55. {agentica-0.1.5 → agentica-0.1.6}/agentica/references.py +0 -0
  56. {agentica-0.1.5 → agentica-0.1.6}/agentica/run_record.py +0 -0
  57. {agentica-0.1.5 → agentica-0.1.6}/agentica/storage/__init__.py +0 -0
  58. {agentica-0.1.5 → agentica-0.1.6}/agentica/storage/base.py +0 -0
  59. {agentica-0.1.5 → agentica-0.1.6}/agentica/storage/pg_storage.py +0 -0
  60. {agentica-0.1.5 → agentica-0.1.6}/agentica/storage/sqlite_storage.py +0 -0
  61. {agentica-0.1.5 → agentica-0.1.6}/agentica/task.py +0 -0
  62. {agentica-0.1.5 → agentica-0.1.6}/agentica/template.py +0 -0
  63. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/__init__.py +0 -0
  64. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/airflow.py +0 -0
  65. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/apify.py +0 -0
  66. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/arxiv.py +0 -0
  67. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/base.py +0 -0
  68. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/dblp.py +0 -0
  69. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/duckduckgo.py +0 -0
  70. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/file.py +0 -0
  71. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/hackernews.py +0 -0
  72. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/jina.py +0 -0
  73. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/ocr.py +0 -0
  74. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/run_nb_code.py +0 -0
  75. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/run_python_code.py +0 -0
  76. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/search_exa.py +0 -0
  77. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/search_serper.py +0 -0
  78. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/shell.py +0 -0
  79. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/sql.py +0 -0
  80. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/url_crawler.py +0 -0
  81. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/wikipedia.py +0 -0
  82. {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/yfinance.py +0 -0
  83. {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/__init__.py +0 -0
  84. {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/file_parser.py +0 -0
  85. {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/log.py +0 -0
  86. {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/misc.py +0 -0
  87. {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/shell.py +0 -0
  88. {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/timer.py +0 -0
  89. {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/__init__.py +0 -0
  90. {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/base.py +0 -0
  91. {agentica-0.1.5 → agentica-0.1.6}/agentica/workflow.py +0 -0
  92. {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/dependency_links.txt +0 -0
  93. {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/entry_points.txt +0 -0
  94. {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/not-zip-safe +0 -0
  95. {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/requires.txt +0 -0
  96. {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/top_level.txt +0 -0
  97. {agentica-0.1.5 → agentica-0.1.6}/setup.cfg +0 -0
  98. {agentica-0.1.5 → agentica-0.1.6}/setup.py +0 -0
  99. {agentica-0.1.5 → agentica-0.1.6}/tests/__init__.py +0 -0
  100. {agentica-0.1.5 → agentica-0.1.6}/tests/test_create_image.py +0 -0
  101. {agentica-0.1.5 → agentica-0.1.6}/tests/test_jina_tool.py +0 -0
  102. {agentica-0.1.5 → agentica-0.1.6}/tests/test_moonshot_llm.py +0 -0
  103. {agentica-0.1.5 → agentica-0.1.6}/tests/test_run_nb_code.py +0 -0
  104. {agentica-0.1.5 → agentica-0.1.6}/tests/test_sqlite_storage.py +0 -0
  105. {agentica-0.1.5 → agentica-0.1.6}/tests/test_url_crawler.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agentica
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: LLM agents
5
5
  Home-page: https://github.com/shibing624/agentica
6
6
  Author: XuMing
@@ -116,11 +116,11 @@ python web_search_deepseek_demo.py
116
116
  自动调用google搜索工具,示例[examples/web_search_deepseek_demo.py](https://github.com/shibing624/agentica/blob/main/examples/web_search_deepseek_demo.py)
117
117
 
118
118
  ```python
119
- from agentica import Assistant, Deepseek
119
+ from agentica import Assistant, DeepseekLLM
120
120
  from agentica.tools.search_serper import SearchSerperTool
121
121
 
122
122
  m = Assistant(
123
- llm=Deepseek(),
123
+ llm=DeepseekLLM(),
124
124
  description="You are a helpful ai assistant.",
125
125
  show_tool_calls=True,
126
126
  # Enable the assistant to search the knowledge base
@@ -85,11 +85,11 @@ python web_search_deepseek_demo.py
85
85
  自动调用google搜索工具,示例[examples/web_search_deepseek_demo.py](https://github.com/shibing624/agentica/blob/main/examples/web_search_deepseek_demo.py)
86
86
 
87
87
  ```python
88
- from agentica import Assistant, Deepseek
88
+ from agentica import Assistant, DeepseekLLM
89
89
  from agentica.tools.search_serper import SearchSerperTool
90
90
 
91
91
  m = Assistant(
92
- llm=Deepseek(),
92
+ llm=DeepseekLLM(),
93
93
  description="You are a helpful ai assistant.",
94
94
  show_tool_calls=True,
95
95
  # Enable the assistant to search the knowledge base
@@ -7,14 +7,14 @@ from agentica.version import __version__ # noqa, isort: skip
7
7
  from agentica.config import AGENTICA_HOME, AGENTICA_DOTENV_PATH, SMART_LLM, FAST_LLM # noqa, isort: skip
8
8
 
9
9
  # llm
10
- from agentica.llm.openai_chat import OpenAIChat
11
- from agentica.llm.azure_openai import AzureOpenAIChat
12
- from agentica.llm.together import Together
13
- from agentica.llm.deepseek import Deepseek
14
- from agentica.llm.moonshot import Moonshot
15
- from agentica.llm.ollama_chat import OllamaChat
16
- from agentica.llm.ollama_tools import OllamaTools
17
- from agentica.llm.claude import Claude
10
+ from agentica.llm.openai_llm import OpenAILLM
11
+ from agentica.llm.azure_openai_llm import AzureOpenAILLM
12
+ from agentica.llm.togetherllm import TogetherLLM
13
+ from agentica.llm.deepseek_llm import DeepseekLLM
14
+ from agentica.llm.moonshot_llm import MoonshotLLM
15
+ from agentica.llm.ollama_llm import OllamaLLM
16
+ from agentica.llm.ollama_tools_llm import OllamaToolsLLM
17
+ from agentica.llm.claude_llm import ClaudeLLM
18
18
 
19
19
  # memory
20
20
  from agentica.message import Message
@@ -40,13 +40,14 @@ from agentica.vectordb.base import VectorDb
40
40
  from agentica.vectordb.memory_vectordb import MemoryVectorDb
41
41
  # emb
42
42
  from agentica.emb.base import Emb
43
- from agentica.emb.openai import OpenAIEmb
44
- from agentica.emb.azure_openai import AzureOpenAIEmb
43
+ from agentica.emb.openai_emb import OpenAIEmb
44
+ from agentica.emb.azure_openai_emb import AzureOpenAIEmb
45
45
  from agentica.emb.hash_emb import HashEmb
46
- from agentica.emb.together import TogetherEmb
47
- from agentica.emb.fireworks import FireworksEmb
48
- from agentica.emb.text2vec import Text2VecEmb
49
- from agentica.emb.word2vec import Word2VecEmb
46
+ from agentica.emb.ollama_emb import OllamaEmb
47
+ from agentica.emb.together_emb import TogetherEmb
48
+ from agentica.emb.fireworks_emb import FireworksEmb
49
+ from agentica.emb.text2vec_emb import Text2VecEmb
50
+ from agentica.emb.word2vec_emb import Word2VecEmb
50
51
 
51
52
  # file
52
53
  from agentica.file.base import File
@@ -31,7 +31,7 @@ from pydantic import BaseModel, ConfigDict, field_validator, ValidationError
31
31
  from agentica.document import Document
32
32
  from agentica.knowledge.knowledge_base import KnowledgeBase
33
33
  from agentica.llm.base import LLM
34
- from agentica.llm.openai_chat import OpenAIChat
34
+ from agentica.llm.openai_llm import OpenAILLM
35
35
  from agentica.memory import AssistantMemory, Memory
36
36
  from agentica.message import Message
37
37
  from agentica.references import References
@@ -279,7 +279,7 @@ class Assistant(BaseModel):
279
279
  def update_llm(self) -> None:
280
280
  if self.llm is None:
281
281
  logger.debug("LLM not set. Using OpenAILLM")
282
- self.llm = OpenAIChat()
282
+ self.llm = OpenAILLM()
283
283
  logger.info(f"Using LLM: {self.llm}")
284
284
  else:
285
285
  logger.debug(f"Using LLM: {self.llm}")
@@ -6,7 +6,7 @@ part of the code from https://github.com/phidatahq/phidata
6
6
  from os import getenv
7
7
  from typing import Optional
8
8
 
9
- from agentica.emb.openai import OpenAIEmb
9
+ from agentica.emb.openai_emb import OpenAIEmb
10
10
 
11
11
 
12
12
  class FireworksEmb(OpenAIEmb):
@@ -14,7 +14,7 @@ except ImportError:
14
14
  raise ImportError("`huggingface-hub` not installed, please run `pip install huggingface-hub`")
15
15
 
16
16
 
17
- class HuggingfaceCustomEmb(Emb):
17
+ class HuggingfaceEmb(Emb):
18
18
  """Huggingface Custom Embedder"""
19
19
 
20
20
  model: str = "jinaai/jina-embeddings-v2-base-code"
@@ -42,12 +42,12 @@ class HuggingfaceCustomEmb(Emb):
42
42
  return self.client.post(**_request_params)
43
43
 
44
44
  def get_embedding(self, text: str) -> List[float]:
45
- response = self._response(text=text)
45
+ resp = []
46
46
  try:
47
- return response
47
+ resp = self._response(text=text)
48
48
  except Exception as e:
49
49
  logger.warning(e)
50
- return []
50
+ return resp
51
51
 
52
52
  def get_embedding_and_usage(self, text: str) -> Tuple[List[float], Optional[Dict]]:
53
53
  return super().get_embedding_and_usage(text)
@@ -4,16 +4,11 @@
4
4
  @description:
5
5
  part of the code from https://github.com/phidatahq/phidata
6
6
  """
7
- from typing import Optional, Dict, List, Any,Tuple
7
+ from typing import Optional, Dict, List, Any, Tuple
8
8
 
9
9
  from agentica.emb.base import Emb
10
10
  from agentica.utils.log import logger
11
11
 
12
- try:
13
- from ollama import Client as OllamaClient
14
- except ImportError:
15
- raise ImportError("`ollama` not installed, please install it via `pip install ollama`")
16
-
17
12
 
18
13
  class OllamaEmb(Emb):
19
14
  model: str = "quentinz/bge-base-zh-v1.5"
@@ -22,10 +17,15 @@ class OllamaEmb(Emb):
22
17
  timeout: Optional[Any] = None
23
18
  options: Optional[Any] = None
24
19
  client_kwargs: Optional[Dict[str, Any]] = None
25
- ollama_client: Optional[OllamaClient] = None
20
+ ollama_client: Optional[Any] = None
26
21
 
27
22
  @property
28
- def client(self) -> OllamaClient:
23
+ def client(self) -> Any:
24
+ try:
25
+ from ollama import Client as OllamaClient
26
+ except ImportError:
27
+ raise ImportError("`ollama` not installed, please run `pip install ollama`")
28
+
29
29
  if self.ollama_client:
30
30
  return self.ollama_client
31
31
 
@@ -58,4 +58,3 @@ class OllamaEmb(Emb):
58
58
 
59
59
  def get_embeddings(self, texts: List[str]) -> List[List[float]]:
60
60
  return [self.get_embedding(text) for text in texts]
61
-
@@ -7,7 +7,7 @@ part of the code from https://github.com/phidatahq/phidata
7
7
  from os import getenv
8
8
  from typing import Optional
9
9
 
10
- from agentica.emb.openai import OpenAIEmb
10
+ from agentica.emb.openai_emb import OpenAIEmb
11
11
 
12
12
 
13
13
  class TogetherEmb(OpenAIEmb):
@@ -3,6 +3,6 @@
3
3
  @author:XuMing(xuming624@qq.com)
4
4
  @description:
5
5
  """
6
- from .azure_openai import AzureOpenAIChat
6
+ from .azure_openai_llm import AzureOpenAILLM
7
7
  from .base import LLM
8
- from .openai_chat import OpenAIChat
8
+ from .openai_llm import OpenAILLM
@@ -10,12 +10,12 @@ from typing import Optional, Dict, Any, List, Iterator
10
10
  from openai import AzureOpenAI as AzureOpenAIClient
11
11
  from openai.types.chat.chat_completion_chunk import ChatCompletionChunk
12
12
  from agentica.config import FAST_LLM
13
- from agentica.llm.openai_chat import OpenAIChat
13
+ from agentica.llm.openai_llm import OpenAILLM
14
14
  from agentica.message import Message
15
15
 
16
16
 
17
- class AzureOpenAIChat(OpenAIChat):
18
- name: str = "AzureOpenAIChat"
17
+ class AzureOpenAILLM(OpenAILLM):
18
+ name: str = "AzureOpenAILLM"
19
19
  model: str = FAST_LLM or "gpt-4o"
20
20
  api_key: Optional[str] = getenv("AZURE_OPENAI_API_KEY")
21
21
  api_version: str = getenv("AZURE_OPENAI_API_VERSION", "2024-02-01")
@@ -30,8 +30,8 @@ except ImportError:
30
30
  anthropic_installed = False
31
31
 
32
32
 
33
- class Claude(LLM):
34
- name: str = "Claude"
33
+ class ClaudeLLM(LLM):
34
+ name: str = "ClaudeLLM"
35
35
  model: str = "claude-3-opus-20240229"
36
36
  # -*- Request parameters
37
37
  max_tokens: Optional[int] = 1024
@@ -56,11 +56,11 @@ from typing import Optional, Dict, Any
56
56
 
57
57
  from openai import OpenAI as OpenAIClient, AsyncOpenAI as AsyncOpenAIClient
58
58
 
59
- from agentica.llm.openai_chat import OpenAIChat
59
+ from agentica.llm.openai_llm import OpenAILLM
60
60
 
61
61
 
62
- class Deepseek(OpenAIChat):
63
- name: str = "Deepseek"
62
+ class DeepseekLLM(OpenAILLM):
63
+ name: str = "DeepseekLLM"
64
64
  model: str = "deepseek-coder"
65
65
  api_key: Optional[str] = getenv("DEEPSEEK_API_KEY")
66
66
  base_url: str = "https://api.deepseek.com/v1"
@@ -8,11 +8,11 @@ from typing import Optional, Dict, Any
8
8
 
9
9
  from openai import OpenAI as OpenAIClient, AsyncOpenAI as AsyncOpenAIClient
10
10
 
11
- from agentica.llm.openai_chat import OpenAIChat
11
+ from agentica.llm.openai_llm import OpenAILLM
12
12
 
13
13
 
14
- class Moonshot(OpenAIChat):
15
- name: str = "Moonshot"
14
+ class MoonshotLLM(OpenAILLM):
15
+ name: str = "MoonshotLLM"
16
16
  model: str = "moonshot-v1-auto"
17
17
  api_key: Optional[str] = getenv("MOONSHOT_API_KEY")
18
18
  base_url: str = "https://api.moonshot.cn/v1"
@@ -97,7 +97,7 @@ def extract_tool_calls(assistant_msg_content: str) -> MessageToolCallExtractionR
97
97
  return MessageToolCallExtractionResult(tool_calls=tool_calls, invalid_json_format=False)
98
98
 
99
99
 
100
- class OllamaChat(LLM):
100
+ class OllamaLLM(LLM):
101
101
  name: str = "OllamaChat"
102
102
  model: str = "openhermes" # or "qwen:0.5b" for test
103
103
  host: Optional[str] = None
@@ -32,7 +32,7 @@ def remove_tool_calls_from_string(text: str, start_tag: str = "<tool_call>", end
32
32
  return text
33
33
 
34
34
 
35
- class OllamaTools(LLM):
35
+ class OllamaToolsLLM(LLM):
36
36
  name: str = "OllamaTools"
37
37
  model: str = "llama3"
38
38
  host: Optional[str] = None
@@ -32,8 +32,8 @@ from agentica.utils.log import logger
32
32
  from agentica.utils.timer import Timer
33
33
 
34
34
 
35
- class OpenAIChat(LLM):
36
- name: str = "OpenAIChat"
35
+ class OpenAILLM(LLM):
36
+ name: str = "OpenAILLM"
37
37
  model: str = FAST_LLM or "gpt-4o-mini"
38
38
  # -*- Request parameters
39
39
  frequency_penalty: Optional[float] = None
@@ -8,14 +8,14 @@ import json
8
8
  from os import getenv
9
9
  from typing import Optional, List, Iterator, Dict, Any
10
10
 
11
- from agentica.llm.openai_chat import OpenAIChat
11
+ from agentica.llm.openai_llm import OpenAILLM
12
12
  from agentica.message import Message
13
13
  from agentica.tools.base import FunctionCall, get_function_call_for_tool_call
14
14
  from agentica.utils.log import logger
15
15
  from agentica.utils.timer import Timer
16
16
 
17
17
 
18
- class Together(OpenAIChat):
18
+ class TogetherLLM(OpenAILLM):
19
19
  name: str = "Together"
20
20
  model: str = "mistralai/Mixtral-8x7B-Instruct-v0.1"
21
21
  api_key: Optional[str] = getenv("TOGETHER_API_KEY")
@@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, model_validator
18
18
 
19
19
  from agentica.config import AGENTICA_HOME
20
20
  from agentica.llm.base import LLM
21
- from agentica.llm.openai_chat import OpenAIChat
21
+ from agentica.llm.openai_llm import OpenAILLM
22
22
  from agentica.message import Message
23
23
  from agentica.references import References
24
24
  from agentica.utils.log import logger
@@ -287,7 +287,7 @@ class MemoryManager(BaseModel):
287
287
 
288
288
  def update_llm(self) -> None:
289
289
  if self.llm is None:
290
- self.llm = OpenAIChat()
290
+ self.llm = OpenAILLM()
291
291
  logger.debug(f"Using LLM: {self.llm}")
292
292
  self.llm.add_tool(self.add_memory)
293
293
  self.llm.add_tool(self.update_memory)
@@ -456,7 +456,7 @@ class MemoryClassifier(BaseModel):
456
456
 
457
457
  def update_llm(self) -> None:
458
458
  if self.llm is None:
459
- self.llm = OpenAIChat()
459
+ self.llm = OpenAILLM()
460
460
  logger.debug(f"Using LLM: {self.llm}")
461
461
 
462
462
  def get_system_prompt(self) -> Optional[str]:
@@ -9,7 +9,7 @@ import base64
9
9
  import os
10
10
  from typing import Optional, cast
11
11
 
12
- from agentica.llm import LLM, OpenAIChat
12
+ from agentica.llm import LLM, OpenAILLM
13
13
  from agentica.tools.base import Toolkit
14
14
  from agentica.utils.log import logger
15
15
 
@@ -37,7 +37,7 @@ class AnalyzeImageTool(Toolkit):
37
37
 
38
38
  def update_llm(self) -> None:
39
39
  if self.llm is None:
40
- self.llm = OpenAIChat()
40
+ self.llm = OpenAILLM()
41
41
 
42
42
  def analyze_image_content(self, image_path_or_url: str) -> str:
43
43
  """
@@ -12,7 +12,7 @@ from typing import Optional, cast
12
12
 
13
13
  import requests
14
14
 
15
- from agentica.llm import LLM, OpenAIChat
15
+ from agentica.llm import LLM, OpenAILLM
16
16
  from agentica.tools.base import Toolkit
17
17
 
18
18
 
@@ -36,7 +36,7 @@ class CreateImageTool(Toolkit):
36
36
 
37
37
  def update_llm(self) -> None:
38
38
  if self.llm is None:
39
- self.llm = OpenAIChat()
39
+ self.llm = OpenAILLM()
40
40
 
41
41
  def create_delle_image(self, prompt: str, n: int = 1, size: str = "1024x1024", model: str = 'dall-e-3') -> str:
42
42
  """
@@ -19,7 +19,7 @@ except ImportError:
19
19
 
20
20
  from agentica.document import Document
21
21
  from agentica.emb.base import Emb
22
- from agentica.emb.openai import OpenAIEmb
22
+ from agentica.emb.openai_emb import OpenAIEmb
23
23
  from agentica.vectordb.base import VectorDb, Distance
24
24
  from agentica.utils.log import logger
25
25
 
@@ -20,7 +20,7 @@ except ImportError:
20
20
  from agentica.document import Document
21
21
  from agentica.emb.base import Emb
22
22
  from agentica.vectordb.base import VectorDb, Distance
23
- from agentica.emb.openai import OpenAIEmb
23
+ from agentica.emb.openai_emb import OpenAIEmb
24
24
  from agentica.utils.log import logger
25
25
 
26
26
 
@@ -11,7 +11,7 @@ import numpy as np
11
11
 
12
12
  from agentica.document import Document
13
13
  from agentica.emb.base import Emb
14
- from agentica.emb.openai import OpenAIEmb
14
+ from agentica.emb.openai_emb import OpenAIEmb
15
15
  from agentica.vectordb.base import VectorDb, Distance
16
16
 
17
17
 
@@ -19,7 +19,7 @@ except ImportError:
19
19
  from agentica.document import Document
20
20
  from agentica.emb.base import Emb
21
21
  from agentica.vectordb.base import VectorDb, Distance
22
- from agentica.emb.openai import OpenAIEmb
22
+ from agentica.emb.openai_emb import OpenAIEmb
23
23
  from agentica.utils.log import logger
24
24
 
25
25
 
@@ -12,7 +12,7 @@ except ImportError:
12
12
 
13
13
  from agentica.document import Document
14
14
  from agentica.emb.base import Emb
15
- from agentica.emb.openai import OpenAIEmb
15
+ from agentica.emb.openai_emb import OpenAIEmb
16
16
  from agentica.vectordb.base import VectorDb, Distance
17
17
  from agentica.utils.log import logger
18
18
 
@@ -11,7 +11,7 @@ except ImportError:
11
11
 
12
12
  from agentica.document import Document
13
13
  from agentica.emb.base import Emb
14
- from agentica.emb.openai import OpenAIEmb
14
+ from agentica.emb.openai_emb import OpenAIEmb
15
15
  from agentica.vectordb.base import VectorDb, Distance
16
16
  from agentica.utils.log import logger
17
17
 
@@ -0,0 +1 @@
1
+ __version__ = "0.1.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agentica
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: LLM agents
5
5
  Home-page: https://github.com/shibing624/agentica
6
6
  Author: XuMing
@@ -116,11 +116,11 @@ python web_search_deepseek_demo.py
116
116
  自动调用google搜索工具,示例[examples/web_search_deepseek_demo.py](https://github.com/shibing624/agentica/blob/main/examples/web_search_deepseek_demo.py)
117
117
 
118
118
  ```python
119
- from agentica import Assistant, Deepseek
119
+ from agentica import Assistant, DeepseekLLM
120
120
  from agentica.tools.search_serper import SearchSerperTool
121
121
 
122
122
  m = Assistant(
123
- llm=Deepseek(),
123
+ llm=DeepseekLLM(),
124
124
  description="You are a helpful ai assistant.",
125
125
  show_tool_calls=True,
126
126
  # Enable the assistant to search the knowledge base
@@ -22,18 +22,18 @@ agentica.egg-info/not-zip-safe
22
22
  agentica.egg-info/requires.txt
23
23
  agentica.egg-info/top_level.txt
24
24
  agentica/emb/__init__.py
25
- agentica/emb/azure_openai.py
25
+ agentica/emb/azure_openai_emb.py
26
26
  agentica/emb/base.py
27
- agentica/emb/fireworks.py
28
- agentica/emb/genimi.py
27
+ agentica/emb/fireworks_emb.py
28
+ agentica/emb/genimi_emb.py
29
29
  agentica/emb/hash_emb.py
30
- agentica/emb/huggingface.py
31
- agentica/emb/ollama.py
32
- agentica/emb/openai.py
33
- agentica/emb/sentence_transformer.py
34
- agentica/emb/text2vec.py
35
- agentica/emb/together.py
36
- agentica/emb/word2vec.py
30
+ agentica/emb/huggingface_emb.py
31
+ agentica/emb/ollama_emb.py
32
+ agentica/emb/openai_emb.py
33
+ agentica/emb/sentence_transformer_emb.py
34
+ agentica/emb/text2vec_emb.py
35
+ agentica/emb/together_emb.py
36
+ agentica/emb/word2vec_emb.py
37
37
  agentica/file/__init__.py
38
38
  agentica/file/base.py
39
39
  agentica/file/csv.py
@@ -43,15 +43,15 @@ agentica/knowledge/knowledge_base.py
43
43
  agentica/knowledge/langchain.py
44
44
  agentica/knowledge/llamaindex.py
45
45
  agentica/llm/__init__.py
46
- agentica/llm/azure_openai.py
46
+ agentica/llm/azure_openai_llm.py
47
47
  agentica/llm/base.py
48
- agentica/llm/claude.py
49
- agentica/llm/deepseek.py
50
- agentica/llm/moonshot.py
51
- agentica/llm/ollama_chat.py
52
- agentica/llm/ollama_tools.py
53
- agentica/llm/openai_chat.py
54
- agentica/llm/together.py
48
+ agentica/llm/claude_llm.py
49
+ agentica/llm/deepseek_llm.py
50
+ agentica/llm/moonshot_llm.py
51
+ agentica/llm/ollama_llm.py
52
+ agentica/llm/ollama_tools_llm.py
53
+ agentica/llm/openai_llm.py
54
+ agentica/llm/togetherllm.py
55
55
  agentica/storage/__init__.py
56
56
  agentica/storage/base.py
57
57
  agentica/storage/pg_storage.py
@@ -8,11 +8,8 @@ This module contains tests for the LLM class.
8
8
  import os
9
9
  from unittest.mock import MagicMock, patch
10
10
 
11
- from agentica.config import AGENTICA_DOTENV_PATH # noqa
12
11
  from agentica.message import Message
13
12
 
14
- api_key = os.getenv("MOONSHOT_API_KEY")
15
-
16
13
 
17
14
  @patch("agentica.llm.openai_llm.OpenAILLM")
18
15
  def test_respond(mock_llm_class):
@@ -1 +0,0 @@
1
- __version__ = "0.1.5"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes