projectdavid 1.33.23__tar.gz → 1.33.24__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.
Potentially problematic release.
This version of projectdavid might be problematic. Click here for more details.
- {projectdavid-1.33.23 → projectdavid-1.33.24}/CHANGELOG.md +7 -0
- {projectdavid-1.33.23/src/projectdavid.egg-info → projectdavid-1.33.24}/PKG-INFO +1 -1
- projectdavid-1.33.24/docs/UPDATE-V133.23.md +153 -0
- projectdavid-1.33.24/docs/inference.md +116 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/threads.md +1 -1
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/vector_store.md +75 -14
- {projectdavid-1.33.23 → projectdavid-1.33.24}/pyproject.toml +1 -1
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/vectors.py +3 -1
- {projectdavid-1.33.23 → projectdavid-1.33.24/src/projectdavid.egg-info}/PKG-INFO +1 -1
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid.egg-info/SOURCES.txt +1 -0
- projectdavid-1.33.23/docs/inference.md +0 -7
- {projectdavid-1.33.23 → projectdavid-1.33.24}/LICENSE +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/MANIFEST.in +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/README.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/assistants.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/code_interpretation.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/database.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/database_assistant_example.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/docker_comtainers.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/file_search.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/files.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/function_call_definition.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/function_calls.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/handling_function_calls.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/messages.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/runs.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/streams.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/tools.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/users.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/docs/versioning.md +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/setup.cfg +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/__init__.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/_version.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/actions_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/api_key_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/assistants_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/base_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/base_vector_store.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/event_handler.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/file_processor.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/file_search.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/files_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/inference_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/messages_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/runs.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/synchronous_inference_wrapper.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/threads_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/tools_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/users_client.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/vector_store_manager.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/vision-file_processor.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/vision_vectors.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/constants/platform.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/decorators.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/entity.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/events.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/serializers.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/services/logging_service.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/synthesis/__init__.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/synthesis/llm_synthesizer.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/synthesis/prompt.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/synthesis/reranker.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/synthesis/retriever.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/utils/__init__.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/utils/function_call_suppressor.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/utils/monitor_launcher.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/utils/peek_gate.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/utils/run_monitor.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/utils/vector_search_formatter.py +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid.egg-info/dependency_links.txt +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid.egg-info/requires.txt +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid.egg-info/top_level.txt +0 -0
- {projectdavid-1.33.23 → projectdavid-1.33.24}/tests/test_clients.py +0 -0
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.33.24](https://github.com/frankie336/projectdavid/compare/v1.33.23...v1.33.24) (2025-06-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Remove Kargs from FileProcessor() ([17a19b3](https://github.com/frankie336/projectdavid/commit/17a19b36f2275bc408b60333f4798b1a462fb96c))
|
|
7
|
+
|
|
1
8
|
## [1.33.23](https://github.com/frankie336/projectdavid/compare/v1.33.22...v1.33.23) (2025-06-17)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: projectdavid
|
|
3
|
-
Version: 1.33.
|
|
3
|
+
Version: 1.33.24
|
|
4
4
|
Summary: Python SDK for interacting with the Entities Assistant API.
|
|
5
5
|
Author-email: Francis Neequaye Armah <francis.neequaye@projectdavid.co.uk>
|
|
6
6
|
License: PolyForm Noncommercial License 1.0.0
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
> **PLEASE NOTE:**
|
|
2
|
+
>
|
|
3
|
+
> As of V1.33.23 Thread creation no longer requires participant_ids to be passed in:
|
|
4
|
+
>
|
|
5
|
+
|
|
6
|
+
```python
|
|
7
|
+
thread = client.threads.create_thread(participant_ids=user.id)
|
|
8
|
+
|
|
9
|
+
# Can be shortened to:
|
|
10
|
+
|
|
11
|
+
thread = client.threads.create_thread()
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Function call error surfacing
|
|
17
|
+
|
|
18
|
+
Function call error trace stack messages are now surfaced to the message dialogue. If the assistant
|
|
19
|
+
does not proactively say so, you can force this with a followup prompt like:
|
|
20
|
+
```python
|
|
21
|
+
"What happened?"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Sometimes it receives the error but does not proactively reveal. Please be aware that your consumers
|
|
25
|
+
will have access to stack trace messages. OpenAI do this, the risk is minimal.
|
|
26
|
+
|
|
27
|
+
# Data Ingestion and Search Methods
|
|
28
|
+
|
|
29
|
+
## Vector Store Standard Data Ingestion Pipeline
|
|
30
|
+
|
|
31
|
+
As of **projectdavid v1.33.23** Json output from function calls are now suppressed by default.
|
|
32
|
+
You can reveal Json output them with:
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
|
|
36
|
+
sync_stream.stream_chunks(
|
|
37
|
+
provider=PROVIDER,
|
|
38
|
+
model=MODEL,
|
|
39
|
+
timeout_per_chunk=60.0,
|
|
40
|
+
suppress_fc=True,
|
|
41
|
+
):
|
|
42
|
+
...
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Please see [here](https://github.com/frankie336/projectdavid/blob/master/docs/inference.md)
|
|
46
|
+
for detailed use example.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## Vector Store Standard Data Ingestion Pipeline
|
|
50
|
+
|
|
51
|
+
Our standard public ingestion method, `VectorStoreClient.add_file_to_vector_store`, will:
|
|
52
|
+
|
|
53
|
+
- Pre-process files.
|
|
54
|
+
- Chunk files.
|
|
55
|
+
- Generate embeddings.
|
|
56
|
+
- Upload processed chunks to the specified vector store.
|
|
57
|
+
- Prepare file contents for semantic search.
|
|
58
|
+
|
|
59
|
+
This method is designed primarily for individual files containing mostly unstructured text. It’s powerful and will cover most Retrieval-Augmented Generation (RAG) use cases.
|
|
60
|
+
|
|
61
|
+
For detailed instructions, please refer to our [usage documentation](https://github.com/frankie336/projectdavid/blob/master/docs/vector_store.md).
|
|
62
|
+
|
|
63
|
+
You can also find a real-world usage example in our cookbook here:
|
|
64
|
+
[Basic Vector Embeddings Search Example](https://github.com/frankie336/entities_cook_book/blob/master/recipes/vector_store/basic_vector_embeddings_search.py).
|
|
65
|
+
|
|
66
|
+
## Your Vector Store Custom Data Ingestion Pipeline
|
|
67
|
+
|
|
68
|
+
We directly leverage our embedding model to craft a customized ingestion pipeline using `FileProcessor.embedding_model`. This pipeline:
|
|
69
|
+
|
|
70
|
+
- Pre-processes structured datasets (e.g., MovieLens).
|
|
71
|
+
- Converts each movie record into its own chunk.
|
|
72
|
+
- Manually constructs rich text embeddings from multiple metadata fields (title, genres, release year, etc.).
|
|
73
|
+
|
|
74
|
+
In summary, this custom pipeline is optimized for granular semantic results from structured datasets such as MovieLens. This approach can easily be adapted to other similar datasets, especially useful in recommendation algorithms.
|
|
75
|
+
|
|
76
|
+
The custom pipeline example is available [here](#).
|
|
77
|
+
|
|
78
|
+
## Search Methods
|
|
79
|
+
|
|
80
|
+
As of **projectdavid v1.33.23** ([PyPI Link](https://pypi.org/project/projectdavid/)), the following search methods are available:
|
|
81
|
+
|
|
82
|
+
### `VectorStoreClient.vector_file_search_raw`
|
|
83
|
+
|
|
84
|
+
> **PLEASE NOTE:**
|
|
85
|
+
>
|
|
86
|
+
> This method was previously named `VectorStoreClient.vector_file_search`. Please update your code accordingly when migrating to v1.33.23.
|
|
87
|
+
|
|
88
|
+
- Returns raw dictionaries with results ranked by corresponding `K` values in descending order.
|
|
89
|
+
- Currently used in our semantic search examples on vectorized instances of the MovieLens dataset.
|
|
90
|
+
|
|
91
|
+
#### Batch Search Example:
|
|
92
|
+
|
|
93
|
+
[Batch Search on MovieLens](https://github.com/frankie336/entities_cook_book/blob/master/recipes/reccomender/batch_search_movielens.py)
|
|
94
|
+
|
|
95
|
+
#### Fuzzy Search App Example:
|
|
96
|
+
|
|
97
|
+
[Fuzzy Search App](https://github.com/frankie336/entities_cook_book/blob/master/recipes/reccomender/search_movielens-v2.py)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### `VectorStoreClient.simple_vector_file_search`
|
|
102
|
+
|
|
103
|
+
Returns a data structure optimized for interpretation and synthesis by LLM models, suitable for function call returns with potential citations.
|
|
104
|
+
|
|
105
|
+
**Example Response:**
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"object": "vector_store.file_search_result",
|
|
110
|
+
"data": [
|
|
111
|
+
{
|
|
112
|
+
"object": "vector_store.file_hit",
|
|
113
|
+
"index": 0,
|
|
114
|
+
"text": "Title: Toy Story. Genres: Animation, Children's, Comedy. Released in 1995.",
|
|
115
|
+
"score": 0.92,
|
|
116
|
+
"meta_data": {
|
|
117
|
+
"item_id": 1,
|
|
118
|
+
"title": "Toy Story",
|
|
119
|
+
"genres": ["Animation", "Children's", "Comedy"],
|
|
120
|
+
"release_year": 1995,
|
|
121
|
+
"IMDb_URL": "http://www.imdb.com/title/tt0114709/"
|
|
122
|
+
},
|
|
123
|
+
"vector_id": "vec_abc123",
|
|
124
|
+
"store_id": "vect_mqfWyNlZbacer73PQu4Upy"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"object": "vector_store.file_hit",
|
|
128
|
+
"index": 1,
|
|
129
|
+
"text": "Title: The Lion King. Genres: Animation, Children's, Musical. Released in 1994.",
|
|
130
|
+
"score": 0.89,
|
|
131
|
+
"meta_data": {
|
|
132
|
+
"item_id": 2,
|
|
133
|
+
"title": "The Lion King",
|
|
134
|
+
"genres": ["Animation", "Children's", "Musical"],
|
|
135
|
+
"release_year": 1994,
|
|
136
|
+
"IMDb_URL": "http://www.imdb.com/title/tt0110357/"
|
|
137
|
+
},
|
|
138
|
+
"vector_id": "vec_def456",
|
|
139
|
+
"store_id": "vect_mqfWyNlZbacer73PQu4Upy"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"answer": "Here are 2 fun kids' movies from the 1990s: **Toy Story** (1995, Animation/Comedy) and **The Lion King** (1994, Animation/Musical). Both are highly rated family films.",
|
|
143
|
+
"query": "fun kids movies from the 1990s"
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### `VectorStoreClient.attended_file_search`
|
|
148
|
+
|
|
149
|
+
Utilizes an integrated AI agent to synthesize analysis and employs a specialized post-processing ranking model to ensure highly precise results. Outputs use a similar envelope as `simple_vector_file_search`. Ideal for quick demonstrations or standalone push-button integrations.
|
|
150
|
+
|
|
151
|
+
### `VectorStoreClient.unattended_file_search`
|
|
152
|
+
|
|
153
|
+
Employs the same advanced post-processing ranking model as `attended_file_search`, but without integrated synthesis. Suitable for standard function call implementations.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
from sympy import python
|
|
2
|
+
|
|
3
|
+
# Inference
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Inference is the final stage of the Entities API workflow, where the assistant processes a prompt and generates a response. This stage highlights the assistant's intelligence and capabilities. Inference can be executed on edge devices or in the cloud, according to your specific needs. Our API supports both options, allowing flexibility tailored to your use case.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Basic Inference Streaming Example
|
|
12
|
+
|
|
13
|
+
The following example demonstrates how to:
|
|
14
|
+
|
|
15
|
+
1. Create an assistant and a thread.
|
|
16
|
+
2. Send a user message.
|
|
17
|
+
3. Initiate a run.
|
|
18
|
+
4. Stream the assistant's response via the Hyperbolic provider.
|
|
19
|
+
|
|
20
|
+
### Requirements
|
|
21
|
+
|
|
22
|
+
Ensure the following environment variables are set:
|
|
23
|
+
|
|
24
|
+
- `ENTITIES_API_KEY`: API key for Entities API access.
|
|
25
|
+
- `BASE_URL`: Base URL of the Entities API instance (default: `http://localhost:9000`).
|
|
26
|
+
- `HYPERBOLIC_API_KEY`: API key for the Hyperbolic provider.
|
|
27
|
+
- `ENTITIES_USER_ID`: User ID associated with the Entities API.
|
|
28
|
+
|
|
29
|
+
### Example Implementation
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import os
|
|
33
|
+
from dotenv import load_dotenv
|
|
34
|
+
from projectdavid import Entity
|
|
35
|
+
|
|
36
|
+
# Load environment variables from .env file
|
|
37
|
+
load_dotenv()
|
|
38
|
+
|
|
39
|
+
# Initialize Entities API client
|
|
40
|
+
client = Entity(
|
|
41
|
+
base_url=os.getenv("BASE_URL", "http://localhost:9000"),
|
|
42
|
+
api_key=os.getenv("ENTITIES_API_KEY")
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
# Constants for Hyperbolic provider
|
|
46
|
+
API_KEY = "your-hyperbolic-key-here"
|
|
47
|
+
|
|
48
|
+
MODEL = "hyperbolic/deepseek-ai/DeepSeek-V3-0324"
|
|
49
|
+
PROVIDER = "Hyperbolic"
|
|
50
|
+
|
|
51
|
+
def main():
|
|
52
|
+
|
|
53
|
+
# Create assistant (can be reused across runs)
|
|
54
|
+
assistant = client.assistants.create_assistant(
|
|
55
|
+
name="test_assistant",
|
|
56
|
+
instructions="You are a helpful AI assistant",)
|
|
57
|
+
|
|
58
|
+
# Create thread (can also be reused)
|
|
59
|
+
thread = client.threads.create_thread()
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# Create user message
|
|
63
|
+
message = client.messages.create_message(
|
|
64
|
+
thread_id=thread.id,
|
|
65
|
+
role="user",
|
|
66
|
+
content="Explain a black hole to me in pure mathematical terms",
|
|
67
|
+
assistant_id=assistant.id
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
# Create a run
|
|
71
|
+
run = client.runs.create_run(
|
|
72
|
+
assistant_id=assistant.id,
|
|
73
|
+
thread_id=thread.id
|
|
74
|
+
)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Stream the Assistant's Response
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
|
|
81
|
+
# --------------------------------------
|
|
82
|
+
#
|
|
83
|
+
# Setup synchronous streaming
|
|
84
|
+
#
|
|
85
|
+
#-----------------------------------------
|
|
86
|
+
sync_stream = client.synchronous_inference_stream
|
|
87
|
+
sync_stream.setup(
|
|
88
|
+
user_id=user_id,
|
|
89
|
+
thread_id=thread.id,
|
|
90
|
+
assistant_id=assistant.id,
|
|
91
|
+
message_id=message.id,
|
|
92
|
+
run_id=run.id,
|
|
93
|
+
api_key=API_KEY
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Stream the assistant's response
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
try:
|
|
100
|
+
for chunk in sync_stream.stream_chunks(
|
|
101
|
+
provider=PROVIDER,
|
|
102
|
+
model=MODEL,
|
|
103
|
+
timeout_per_chunk=60.0,
|
|
104
|
+
suppress_fc=True,
|
|
105
|
+
):
|
|
106
|
+
content = chunk.get("content", "")
|
|
107
|
+
if content:
|
|
108
|
+
print(content, end="", flush=True)
|
|
109
|
+
print("\n--- End of Stream ---")
|
|
110
|
+
except Exception as e:
|
|
111
|
+
print(f"Stream Error: {e}")
|
|
112
|
+
|
|
113
|
+
if __name__ == "__main__":
|
|
114
|
+
main()
|
|
115
|
+
|
|
116
|
+
```
|
|
@@ -14,13 +14,15 @@ Associated methods can be used to extend the memory and contextual recall of AI
|
|
|
14
14
|
## Basic Vector Store Operations
|
|
15
15
|
|
|
16
16
|
```python
|
|
17
|
+
import os
|
|
17
18
|
from projectdavid import Entity
|
|
18
19
|
|
|
19
|
-
client = Entity()
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
client = Entity(
|
|
22
|
+
base_url=os.getenv("BASE_URL", "http://localhost:9000"),
|
|
23
|
+
api_key=os.getenv("ENTITIES_API_KEY"), #This is the entities user API Key
|
|
24
|
+
)
|
|
25
|
+
|
|
24
26
|
|
|
25
27
|
# create a vector store
|
|
26
28
|
store = client.vectors.create_vector_store(
|
|
@@ -71,25 +73,89 @@ client = Entity()
|
|
|
71
73
|
|
|
72
74
|
save_file_to_store = client.vectors.add_file_to_vector_store(
|
|
73
75
|
vector_store_id='vect_WsdjjLHoQqyMLmCdrvShc6',
|
|
74
|
-
file_path='
|
|
76
|
+
file_path='Donoghue_v_Stevenson__1932__UKHL_100__26_May_1932_.pdf'
|
|
75
77
|
)
|
|
76
78
|
```
|
|
79
|
+
Text is split, embedded into a vector space, enriched with metadata, and pushed into a vector database.
|
|
80
|
+
This allows for semantic search over its contents.
|
|
81
|
+
---
|
|
77
82
|
|
|
78
|
-
At this point, your file has been vectorized to your store.
|
|
79
83
|
|
|
84
|
+
## Search Methods
|
|
85
|
+
The Entities Vector Store supports four distinct search methods, each tailored to a specific use case:
|
|
80
86
|
|
|
81
|
-
---
|
|
82
87
|
|
|
83
|
-
|
|
88
|
+
```VectorStoreClient.vector_file_search_raw```
|
|
89
|
+
Returns raw similarity-ranked vectors with full metadata. Best for low-level access or post-processing.
|
|
84
90
|
|
|
91
|
+
````python
|
|
92
|
+
client = Entity(
|
|
93
|
+
base_url=os.getenv("BASE_URL", "http://localhost:9000"),
|
|
94
|
+
api_key=os.getenv("ENTITIES_API_KEY"), #This is the entities user API Key
|
|
95
|
+
)
|
|
85
96
|
|
|
86
97
|
|
|
87
|
-
|
|
98
|
+
client.vectors.vector_file_search_raw(
|
|
99
|
+
vector_store_id = store.id
|
|
100
|
+
query_text = 'Explain the neighbour principle'
|
|
101
|
+
|
|
102
|
+
)
|
|
88
103
|
|
|
104
|
+
````
|
|
89
105
|
|
|
106
|
+
```VectorStoreClient.simple_vector_file_search``` Returns a structured response optimized for LLM consumption — useful in function calls with citation-ready output.
|
|
90
107
|
|
|
108
|
+
````python
|
|
109
|
+
client = Entity(
|
|
110
|
+
base_url=os.getenv("BASE_URL", "http://localhost:9000"),
|
|
111
|
+
api_key=os.getenv("ENTITIES_API_KEY"), #This is the entities user API Key
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
client.vectors.simple_vector_file_search(
|
|
116
|
+
vector_store_id = store.id
|
|
117
|
+
query_text = 'Explain the neighbour principle'
|
|
118
|
+
|
|
119
|
+
)
|
|
120
|
+
````
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
```VectorStoreClient.attended_file_search```Performs search, ranking, and synthesis using an internal agent. Ideal for push-button demos or standalone assistants.
|
|
124
|
+
|
|
125
|
+
````python
|
|
126
|
+
client = Entity(
|
|
127
|
+
base_url=os.getenv("BASE_URL", "http://localhost:9000"),
|
|
128
|
+
api_key=os.getenv("ENTITIES_API_KEY"), #This is the entities user API Key
|
|
129
|
+
)
|
|
91
130
|
|
|
92
131
|
|
|
132
|
+
client.vectors.attended_file_search(
|
|
133
|
+
vector_store_id = store.id
|
|
134
|
+
query_text = 'Explain the neighbour principle'
|
|
135
|
+
|
|
136
|
+
)
|
|
137
|
+
````
|
|
138
|
+
|
|
139
|
+
```VectorStoreClient.unattended_file_search```Performs high-precision search with post-ranking, but without synthesis. Use this in toolchains or function-calling workflows.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
````python
|
|
144
|
+
client = Entity(
|
|
145
|
+
base_url=os.getenv("BASE_URL", "http://localhost:9000"),
|
|
146
|
+
api_key=os.getenv("ENTITIES_API_KEY"), #This is the entities user API Key
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
client.vectors.unattended_file_search(
|
|
151
|
+
vector_store_id = store.id
|
|
152
|
+
query_text = 'Explain the neighbour principle'
|
|
153
|
+
|
|
154
|
+
)
|
|
155
|
+
````
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
---
|
|
93
159
|
|
|
94
160
|
- The assistant will self-select appropriate vector store
|
|
95
161
|
searches using its latent logic when responding to a prompt.
|
|
@@ -134,11 +200,6 @@ list_store_files(vector_store_id) → List[VectorStoreFileRead]
|
|
|
134
200
|
update_vector_store_file_status(vector_store_id, file_id, status, error_message=None) → VectorStoreFileRead
|
|
135
201
|
```
|
|
136
202
|
|
|
137
|
-
### Search
|
|
138
|
-
|
|
139
|
-
```python
|
|
140
|
-
search_vector_store(vector_store_id, query_text, top_k=5, filters=None) → List[dict]
|
|
141
|
-
```
|
|
142
203
|
|
|
143
204
|
### Assistant Integration
|
|
144
205
|
|
|
@@ -92,7 +92,9 @@ class VectorStoreClient:
|
|
|
92
92
|
self.identifier_service = UtilsInterface.IdentifierService()
|
|
93
93
|
|
|
94
94
|
# 🔶 forward kwargs into the upgraded FileProcessor
|
|
95
|
-
self.file_processor = FileProcessor(**(file_processor_kwargs or {}))
|
|
95
|
+
# self.file_processor = FileProcessor(**(file_processor_kwargs or {}))
|
|
96
|
+
# Using Stripped down version for now until we move forward with multi-modal stores
|
|
97
|
+
self.file_processor = FileProcessor()
|
|
96
98
|
|
|
97
99
|
log.info("VectorStoreClient → %s", self.base_url)
|
|
98
100
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: projectdavid
|
|
3
|
-
Version: 1.33.
|
|
3
|
+
Version: 1.33.24
|
|
4
4
|
Summary: Python SDK for interacting with the Entities Assistant API.
|
|
5
5
|
Author-email: Francis Neequaye Armah <francis.neequaye@projectdavid.co.uk>
|
|
6
6
|
License: PolyForm Noncommercial License 1.0.0
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Inference
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
Inference is the final stage of the Entities API workflow, where the assistant processes a prompt and generates a reply. This stage is where the magic happens, and the assistant’s intelligence is put to the test. Inference can be performed on edge devices or in the cloud, depending on your specific requirements and constraints. Our API supports both options, allowing you to choose the best approach for your use case.
|
|
6
|
-
|
|
7
|
-
...In progess, please check here soon.
|
|
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
|
{projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/vector_store_manager.py
RENAMED
|
File without changes
|
{projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/clients/vision-file_processor.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
|
{projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/utils/function_call_suppressor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid/utils/vector_search_formatter.py
RENAMED
|
File without changes
|
{projectdavid-1.33.23 → projectdavid-1.33.24}/src/projectdavid.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|