-
Notifications
You must be signed in to change notification settings - Fork 679
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Isaac Jin <[email protected]>
- Loading branch information
1 parent
4c3b023
commit c36cb5c
Showing
21 changed files
with
1,053 additions
and
589 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ Some features require extra dependencies: | |
|
||
Install `CAMEL` from source with poetry (Recommended): | ||
```sh | ||
# Make sure your python version is later than 3.9 | ||
# Make sure your python version is later than 3.10 | ||
# You can use pyenv to manage multiple python verisons in your sytstem | ||
# Clone github repo | ||
|
@@ -104,7 +104,7 @@ exit | |
Install `CAMEL` from source with conda and pip: | ||
```sh | ||
# Create a conda virtual environment | ||
conda create --name camel python=3.9 | ||
conda create --name camel python=3.10 | ||
# Activate CAMEL conda environment | ||
conda activate camel | ||
|
@@ -323,8 +323,8 @@ We appreciate your interest in contributing to our open-source initiative. We pr | |
## Contact | ||
For more information please contact [email protected]. | ||
[python-image]: https://img.shields.io/badge/Python-3.9%2B-brightgreen.svg | ||
[python-url]: https://docs.python.org/3.9/ | ||
[python-image]: https://img.shields.io/badge/Python-3.10%2B-brightgreen.svg | ||
[python-url]: https://docs.python.org/3.10/ | ||
[pytest-image]: https://github.com/camel-ai/camel/actions/workflows/pytest_package.yml/badge.svg | ||
[pytest-url]: https://github.com/camel-ai/camel/actions/workflows/pytest_package.yml | ||
[docs-image]: https://img.shields.io/badge/Documentation-grey.svg?logo=github | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. =========== | ||
# Licensed under the Apache License, Version 2.0 (the “License”); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an “AS IS” BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. =========== | ||
from __future__ import annotations | ||
|
||
from typing import Any, Optional, Union | ||
|
||
from camel.configs.base_config import BaseConfig | ||
|
||
|
||
class RekaConfig(BaseConfig): | ||
r"""Defines the parameters for generating chat completions using the | ||
Reka API. | ||
Reference: https://docs.reka.ai/api-reference/chat/create | ||
Args: | ||
temperature (Optional[float], optional): temperature the temperature | ||
to use for sampling, e.g. 0.5. | ||
top_p (Optional[float], optional): the cumulative probability of | ||
tokens to generate, e.g. 0.9. Defaults to None. | ||
top_k (Optional[int], optional): Parameter which forces the model to | ||
only consider the tokens with the `top_k` highest probabilities at | ||
the next step. Defaults to 1024. | ||
max_tokens (Optional[int], optional): the maximum number of tokens to | ||
generate, e.g. 100. Defaults to None. | ||
stop (Optional[Union[str,list[str]]]): Stop generation if this token | ||
is detected. Or if one of these tokens is detected when providing | ||
a string list. | ||
seed (Optional[int], optional): the random seed to use for sampling, e. | ||
g. 42. Defaults to None. | ||
presence_penalty (float, optional): Number between :obj:`-2.0` and | ||
:obj:`2.0`. Positive values penalize new tokens based on whether | ||
they appear in the text so far, increasing the model's likelihood | ||
to talk about new topics. See more information about frequency and | ||
presence penalties. (default: :obj:`0.0`) | ||
frequency_penalty (float, optional): Number between :obj:`-2.0` and | ||
:obj:`2.0`. Positive values penalize new tokens based on their | ||
existing frequency in the text so far, decreasing the model's | ||
likelihood to repeat the same line verbatim. See more information | ||
about frequency and presence penalties. (default: :obj:`0.0`) | ||
use_search_engine (Optional[bool]): Whether to consider using search | ||
engine to complete the request. Note that even if this is set to | ||
`True`, the model might decide to not use search. | ||
""" | ||
|
||
temperature: Optional[float] = None | ||
top_p: Optional[float] = None | ||
top_k: Optional[int] = None | ||
max_tokens: Optional[int] = None | ||
stop: Optional[Union[str, list[str]]] = None | ||
seed: Optional[int] = None | ||
frequency_penalty: float = 0.0 | ||
presence_penalty: float = 0.0 | ||
use_search_engine: Optional[bool] = False | ||
|
||
def as_dict(self) -> dict[str, Any]: | ||
config_dict = super().as_dict() | ||
if "tools" in config_dict: | ||
del config_dict["tools"] # Reka does not support tool calling | ||
return config_dict | ||
|
||
|
||
REKA_API_PARAMS = {param for param in RekaConfig().model_fields.keys()} |
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
Oops, something went wrong.