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.
- {agentica-0.1.5 → agentica-0.1.6}/PKG-INFO +3 -3
- {agentica-0.1.5 → agentica-0.1.6}/README.md +2 -2
- {agentica-0.1.5 → agentica-0.1.6}/agentica/__init__.py +15 -14
- {agentica-0.1.5 → agentica-0.1.6}/agentica/assistant.py +2 -2
- agentica-0.1.5/agentica/emb/fireworks.py → agentica-0.1.6/agentica/emb/fireworks_emb.py +1 -1
- agentica-0.1.5/agentica/emb/huggingface.py → agentica-0.1.6/agentica/emb/huggingface_emb.py +4 -4
- agentica-0.1.5/agentica/emb/ollama.py → agentica-0.1.6/agentica/emb/ollama_emb.py +8 -9
- agentica-0.1.5/agentica/emb/together.py → agentica-0.1.6/agentica/emb/together_emb.py +1 -1
- {agentica-0.1.5 → agentica-0.1.6}/agentica/llm/__init__.py +2 -2
- agentica-0.1.5/agentica/llm/azure_openai.py → agentica-0.1.6/agentica/llm/azure_openai_llm.py +3 -3
- agentica-0.1.5/agentica/llm/claude.py → agentica-0.1.6/agentica/llm/claude_llm.py +2 -2
- agentica-0.1.5/agentica/llm/deepseek.py → agentica-0.1.6/agentica/llm/deepseek_llm.py +3 -3
- agentica-0.1.5/agentica/llm/moonshot.py → agentica-0.1.6/agentica/llm/moonshot_llm.py +3 -3
- agentica-0.1.5/agentica/llm/ollama_chat.py → agentica-0.1.6/agentica/llm/ollama_llm.py +1 -1
- agentica-0.1.5/agentica/llm/ollama_tools.py → agentica-0.1.6/agentica/llm/ollama_tools_llm.py +1 -1
- agentica-0.1.5/agentica/llm/openai_chat.py → agentica-0.1.6/agentica/llm/openai_llm.py +2 -2
- agentica-0.1.5/agentica/llm/together.py → agentica-0.1.6/agentica/llm/togetherllm.py +2 -2
- {agentica-0.1.5 → agentica-0.1.6}/agentica/memory.py +3 -3
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/analyze_image.py +2 -2
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/create_image.py +2 -2
- {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/chromadb.py +1 -1
- {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/lancedb.py +1 -1
- {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/memory_vectordb.py +1 -1
- {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/pgvector.py +1 -1
- {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/pineconedb.py +1 -1
- {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/qdrant.py +1 -1
- agentica-0.1.6/agentica/version.py +1 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/PKG-INFO +3 -3
- {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/SOURCES.txt +18 -18
- {agentica-0.1.5 → agentica-0.1.6}/tests/test_llm.py +0 -3
- agentica-0.1.5/agentica/version.py +0 -1
- {agentica-0.1.5 → agentica-0.1.6}/LICENSE +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/config.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/document.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/emb/__init__.py +0 -0
- /agentica-0.1.5/agentica/emb/azure_openai.py → /agentica-0.1.6/agentica/emb/azure_openai_emb.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/emb/base.py +0 -0
- /agentica-0.1.5/agentica/emb/genimi.py → /agentica-0.1.6/agentica/emb/genimi_emb.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/emb/hash_emb.py +0 -0
- /agentica-0.1.5/agentica/emb/openai.py → /agentica-0.1.6/agentica/emb/openai_emb.py +0 -0
- /agentica-0.1.5/agentica/emb/sentence_transformer.py → /agentica-0.1.6/agentica/emb/sentence_transformer_emb.py +0 -0
- /agentica-0.1.5/agentica/emb/text2vec.py → /agentica-0.1.6/agentica/emb/text2vec_emb.py +0 -0
- /agentica-0.1.5/agentica/emb/word2vec.py → /agentica-0.1.6/agentica/emb/word2vec_emb.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/file/__init__.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/file/base.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/file/csv.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/file/txt.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/knowledge/__init__.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/knowledge/knowledge_base.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/knowledge/langchain.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/knowledge/llamaindex.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/llm/base.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/message.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/python_assistant.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/references.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/run_record.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/storage/__init__.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/storage/base.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/storage/pg_storage.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/storage/sqlite_storage.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/task.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/template.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/__init__.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/airflow.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/apify.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/arxiv.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/base.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/dblp.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/duckduckgo.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/file.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/hackernews.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/jina.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/ocr.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/run_nb_code.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/run_python_code.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/search_exa.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/search_serper.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/shell.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/sql.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/url_crawler.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/wikipedia.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/tools/yfinance.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/__init__.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/file_parser.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/log.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/misc.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/shell.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/utils/timer.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/__init__.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/vectordb/base.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica/workflow.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/dependency_links.txt +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/entry_points.txt +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/not-zip-safe +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/requires.txt +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/agentica.egg-info/top_level.txt +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/setup.cfg +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/setup.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/tests/__init__.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/tests/test_create_image.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/tests/test_jina_tool.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/tests/test_moonshot_llm.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/tests/test_run_nb_code.py +0 -0
- {agentica-0.1.5 → agentica-0.1.6}/tests/test_sqlite_storage.py +0 -0
- {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.
|
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,
|
119
|
+
from agentica import Assistant, DeepseekLLM
|
120
120
|
from agentica.tools.search_serper import SearchSerperTool
|
121
121
|
|
122
122
|
m = Assistant(
|
123
|
-
llm=
|
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,
|
88
|
+
from agentica import Assistant, DeepseekLLM
|
89
89
|
from agentica.tools.search_serper import SearchSerperTool
|
90
90
|
|
91
91
|
m = Assistant(
|
92
|
-
llm=
|
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.
|
11
|
-
from agentica.llm.
|
12
|
-
from agentica.llm.
|
13
|
-
from agentica.llm.
|
14
|
-
from agentica.llm.
|
15
|
-
from agentica.llm.
|
16
|
-
from agentica.llm.
|
17
|
-
from agentica.llm.
|
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.
|
44
|
-
from agentica.emb.
|
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.
|
47
|
-
from agentica.emb.
|
48
|
-
from agentica.emb.
|
49
|
-
from agentica.emb.
|
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.
|
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 =
|
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}")
|
@@ -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
|
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
|
-
|
45
|
+
resp = []
|
46
46
|
try:
|
47
|
-
|
47
|
+
resp = self._response(text=text)
|
48
48
|
except Exception as e:
|
49
49
|
logger.warning(e)
|
50
|
-
|
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[
|
20
|
+
ollama_client: Optional[Any] = None
|
26
21
|
|
27
22
|
@property
|
28
|
-
def client(self) ->
|
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
|
-
|
agentica-0.1.5/agentica/llm/azure_openai.py → agentica-0.1.6/agentica/llm/azure_openai_llm.py
RENAMED
@@ -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.
|
13
|
+
from agentica.llm.openai_llm import OpenAILLM
|
14
14
|
from agentica.message import Message
|
15
15
|
|
16
16
|
|
17
|
-
class
|
18
|
-
name: str = "
|
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
|
34
|
-
name: str = "
|
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.
|
59
|
+
from agentica.llm.openai_llm import OpenAILLM
|
60
60
|
|
61
61
|
|
62
|
-
class
|
63
|
-
name: str = "
|
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.
|
11
|
+
from agentica.llm.openai_llm import OpenAILLM
|
12
12
|
|
13
13
|
|
14
|
-
class
|
15
|
-
name: str = "
|
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
|
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,8 +32,8 @@ from agentica.utils.log import logger
|
|
32
32
|
from agentica.utils.timer import Timer
|
33
33
|
|
34
34
|
|
35
|
-
class
|
36
|
-
name: str = "
|
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.
|
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
|
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.
|
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 =
|
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 =
|
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,
|
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 =
|
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,
|
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 =
|
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.
|
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.
|
23
|
+
from agentica.emb.openai_emb import OpenAIEmb
|
24
24
|
from agentica.utils.log import logger
|
25
25
|
|
26
26
|
|
@@ -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.
|
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.
|
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.
|
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.
|
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,
|
119
|
+
from agentica import Assistant, DeepseekLLM
|
120
120
|
from agentica.tools.search_serper import SearchSerperTool
|
121
121
|
|
122
122
|
m = Assistant(
|
123
|
-
llm=
|
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/
|
25
|
+
agentica/emb/azure_openai_emb.py
|
26
26
|
agentica/emb/base.py
|
27
|
-
agentica/emb/
|
28
|
-
agentica/emb/
|
27
|
+
agentica/emb/fireworks_emb.py
|
28
|
+
agentica/emb/genimi_emb.py
|
29
29
|
agentica/emb/hash_emb.py
|
30
|
-
agentica/emb/
|
31
|
-
agentica/emb/
|
32
|
-
agentica/emb/
|
33
|
-
agentica/emb/
|
34
|
-
agentica/emb/
|
35
|
-
agentica/emb/
|
36
|
-
agentica/emb/
|
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/
|
46
|
+
agentica/llm/azure_openai_llm.py
|
47
47
|
agentica/llm/base.py
|
48
|
-
agentica/llm/
|
49
|
-
agentica/llm/
|
50
|
-
agentica/llm/
|
51
|
-
agentica/llm/
|
52
|
-
agentica/llm/
|
53
|
-
agentica/llm/
|
54
|
-
agentica/llm/
|
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
|
/agentica-0.1.5/agentica/emb/azure_openai.py → /agentica-0.1.6/agentica/emb/azure_openai_emb.py
RENAMED
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
|
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
|
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
|
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
|