-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🪙 Calculate Max tokens * 🐛 Fix mypy issues * 🐛 Fix prompt token calc * 🐛 Fix tests * 🐛 Fix tests
- Loading branch information
Showing
10 changed files
with
96 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 26 additions & 18 deletions
44
platform/reworkd_platform/tests/agent/agent/create_model_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
import itertools | ||
|
||
import pytest | ||
|
||
from reworkd_platform.schemas import ModelSettings | ||
from reworkd_platform.web.api.agent.agent_service.open_ai_agent_service import ( | ||
create_model, | ||
) | ||
from reworkd_platform.schemas import ModelSettings, UserBase | ||
from reworkd_platform.web.api.agent.model_settings import create_model | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"settings", | ||
[ | ||
ModelSettings( | ||
customTemperature=0.222, | ||
customModelName="gpt-4", | ||
maxTokens=1234, | ||
), | ||
ModelSettings(), | ||
], | ||
"settings, streaming", | ||
list( | ||
itertools.product( | ||
[ | ||
ModelSettings( | ||
customTemperature=0.222, | ||
customModelName="gpt-4", | ||
maxTokens=1234, | ||
), | ||
ModelSettings(), | ||
], | ||
[True, False], | ||
) | ||
), | ||
) | ||
def test_create_model( | ||
settings: ModelSettings, | ||
): | ||
model = create_model(settings) | ||
def test_create_model(settings: ModelSettings, streaming: bool): | ||
model = create_model( | ||
settings, | ||
UserBase(id="", email="[email protected]"), | ||
streaming=streaming, | ||
) | ||
|
||
assert model.temperature == settings.temperature | ||
assert model.model_name == settings.model | ||
assert model.model_name.startswith(settings.model) | ||
assert model.max_tokens == settings.max_tokens | ||
assert model.streaming == streaming |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66aabcf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./docs
docs.reworkd.ai
docs-reworkd.vercel.app
docs-git-main-reworkd.vercel.app