Skip to content

Commit 1b7c424

Browse files
committed
Merge branch 'main' into bump-11-2
2 parents b529b1e + e141a40 commit 1b7c424

File tree

16 files changed

+2395
-91
lines changed

16 files changed

+2395
-91
lines changed

.github/workflows/notify-letta-cloud.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

examples/files/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ The demo will:
3131
3. Create an agent named "Clippy"
3232
4. Start an interactive chat session
3333

34-
Type 'quit' or 'exit' to end the conversation.
34+
Type 'quit' or 'exit' to end the conversation.

examples/files/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
# 1. From an existing file
6464
# 2. From a string by encoding it into a base64 string
6565
#
66-
#
6766

6867
# 1. From an existing file
6968
# "rb" means "read binary"

letta/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
__version__ = version("letta")
66
except PackageNotFoundError:
77
# Fallback for development installations
8-
__version__ = "0.10.0"
8+
__version__ = "0.11.0"
99

1010
if os.environ.get("LETTA_VERSION"):
1111
__version__ = os.environ["LETTA_VERSION"]

letta/constants.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
ADMIN_PREFIX = "/v1/admin"
1212
API_PREFIX = "/v1"
13+
OLLAMA_API_PREFIX = "/v1"
1314
OPENAI_API_PREFIX = "/openai"
1415

1516
COMPOSIO_ENTITY_ENV_VAR_KEY = "COMPOSIO_ENTITY"
@@ -50,8 +51,9 @@
5051
# Max steps for agent loop
5152
DEFAULT_MAX_STEPS = 50
5253

53-
# minimum context window size
54+
# context window size
5455
MIN_CONTEXT_WINDOW = 4096
56+
DEFAULT_CONTEXT_WINDOW = 32000
5557

5658
# number of concurrent embedding requests to sent
5759
EMBEDDING_BATCH_SIZE = 200
@@ -63,6 +65,7 @@
6365
# embeddings
6466
MAX_EMBEDDING_DIM = 4096 # maximum supported embeding size - do NOT change or else DBs will need to be reset
6567
DEFAULT_EMBEDDING_CHUNK_SIZE = 300
68+
DEFAULT_EMBEDDING_DIM = 1024
6669

6770
# tokenizers
6871
EMBEDDING_TO_TOKENIZER_MAP = {

letta/embeddings.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,11 @@ def get_text_embedding(self, text: str):
139139

140140
class OllamaEmbeddings:
141141

142+
# Uses OpenAI API standard
142143
# Format:
143-
# curl http://localhost:11434/api/embeddings -d '{
144+
# curl http://localhost:11434/v1/embeddings -d '{
144145
# "model": "mxbai-embed-large",
145-
# "prompt": "Llamas are members of the camelid family"
146+
# "input": "Llamas are members of the camelid family"
146147
# }'
147148

148149
def __init__(self, model: str, base_url: str, ollama_additional_kwargs: dict):
@@ -154,18 +155,18 @@ def get_text_embedding(self, text: str):
154155
import httpx
155156

156157
headers = {"Content-Type": "application/json"}
157-
json_data = {"model": self.model, "prompt": text}
158+
json_data = {"model": self.model, "input": text}
158159
json_data.update(self.ollama_additional_kwargs)
159160

160161
with httpx.Client() as client:
161162
response = client.post(
162-
f"{self.base_url}/api/embeddings",
163+
f"{self.base_url}/embeddings",
163164
headers=headers,
164165
json=json_data,
165166
)
166167

167168
response_json = response.json()
168-
return response_json["embedding"]
169+
return response_json["data"][0]["embedding"]
169170

170171

171172
class GoogleEmbeddings:

0 commit comments

Comments
 (0)