Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
math_tutor_dev
public_math_tutor
Commits
b61d4201
Commit
b61d4201
authored
May 28, 2026
by
Kantz
Browse files
timeout entfernt
parent
0a925bf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
math-tutor/backend/app/deterministic_services/embeddings.py
View file @
b61d4201
...
@@ -27,7 +27,6 @@ class OpenAILikeConfig(BaseModel):
...
@@ -27,7 +27,6 @@ class OpenAILikeConfig(BaseModel):
model
:
str
=
Field
(...,
model
:
str
=
Field
(...,
description
=
"Modellname (z. B. 'nomic-embed-text')"
)
description
=
"Modellname (z. B. 'nomic-embed-text')"
)
target_dim
:
int
=
Field
(
1024
,
description
=
"Ziel-Dimension der Embeddings"
)
target_dim
:
int
=
Field
(
1024
,
description
=
"Ziel-Dimension der Embeddings"
)
timeout
:
float
|
None
=
Field
(
None
,
description
=
"Request timeout in seconds"
)
class
SentenceTransformerConfig
(
BaseModel
):
class
SentenceTransformerConfig
(
BaseModel
):
...
@@ -100,14 +99,12 @@ class OpenAILikeEmbeddings(BaseEmbeddings):
...
@@ -100,14 +99,12 @@ class OpenAILikeEmbeddings(BaseEmbeddings):
self
.
base_url
=
config
.
base_url
.
rstrip
(
"/"
)
self
.
base_url
=
config
.
base_url
.
rstrip
(
"/"
)
self
.
api_key
=
config
.
api_key
self
.
api_key
=
config
.
api_key
self
.
model
=
config
.
model
self
.
model
=
config
.
model
self
.
timeout
=
config
.
timeout
or
60.0
def
_embed
(
self
,
inputs
:
List
[
str
]
|
str
)
->
List
[
List
[
float
]]:
def
_embed
(
self
,
inputs
:
List
[
str
]
|
str
)
->
List
[
List
[
float
]]:
"""Ruft die externe Embedding-API auf."""
"""Ruft die externe Embedding-API auf."""
client
=
OpenAI
(
client
=
OpenAI
(
api_key
=
self
.
api_key
,
api_key
=
self
.
api_key
,
base_url
=
self
.
base_url
,
base_url
=
self
.
base_url
,
timeout
=
self
.
timeout
,
)
)
response
=
client
.
embeddings
.
create
(
response
=
client
.
embeddings
.
create
(
input
=
inputs
,
input
=
inputs
,
...
...
math-tutor/backend/test/embeddings_jina_v5_unit_test.py
View file @
b61d4201
...
@@ -92,7 +92,6 @@ class SentenceTransformerJinaV5Test(unittest.TestCase):
...
@@ -92,7 +92,6 @@ class SentenceTransformerJinaV5Test(unittest.TestCase):
api_key
=
"gwdg-key"
,
api_key
=
"gwdg-key"
,
model
=
"e5-mistral-7b-instruct"
,
model
=
"e5-mistral-7b-instruct"
,
target_dim
=
2
,
target_dim
=
2
,
timeout
=
12.5
,
)
)
)
)
result
=
embedder
.
embed_documents
([
"a"
,
"b"
])
result
=
embedder
.
embed_documents
([
"a"
,
"b"
])
...
@@ -102,7 +101,6 @@ class SentenceTransformerJinaV5Test(unittest.TestCase):
...
@@ -102,7 +101,6 @@ class SentenceTransformerJinaV5Test(unittest.TestCase):
{
{
"api_key"
:
"gwdg-key"
,
"api_key"
:
"gwdg-key"
,
"base_url"
:
"https://chat-ai.academiccloud.de/v1"
,
"base_url"
:
"https://chat-ai.academiccloud.de/v1"
,
"timeout"
:
12.5
,
},
},
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment