-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/runtime
- Loading branch information
Showing
28 changed files
with
1,743 additions
and
713 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# To use these environment variables: | ||
# 1. Populate the .env file with your API keys. | ||
# 2. Include the following code snippet in your Python script: | ||
# from dotenv import load_dotenv | ||
# import os | ||
# | ||
# load_dotenv() # Load environment variables from .env file | ||
|
||
#=========================================== | ||
# Models API | ||
#=========================================== | ||
|
||
# OpenAI API (https://platform.openai.com/signup) | ||
OPENAI_API_KEY="Fill your API key here" | ||
|
||
# Anthropic API (https://www.anthropic.com/) | ||
ANTHROPIC_API_KEY="Fill your API key here" | ||
|
||
# Groq API (https://groq.com/) | ||
GROQ_API_KEY="Fill your API key here" | ||
|
||
# Cohere API (https://cohere.ai/) | ||
COHERE_API_KEY="Fill your API key here" | ||
|
||
# Hugging Face API (https://huggingface.co/join) | ||
HF_TOKEN="Fill your API key here" | ||
|
||
# Azure OpenAI API (https://azure.microsoft.com/products/cognitive-services/openai-service/) | ||
AZURE_OPENAI_API_KEY="Fill your API key here" | ||
AZURE_API_VERSION="Fill your API Version here" | ||
AZURE_DEPLOYMENT_NAME="Fill your Deployment Name here" | ||
AZURE_OPENAI_BASE_URL="Fill your Base URL here" | ||
|
||
# Mistral API (https://mistral.ai/) | ||
MISTRAL_API_KEY="Fill your API key here" | ||
|
||
# Reka API (https://www.reka.ai/) | ||
REKA_API_KEY="Fill your API key here" | ||
|
||
# Zhipu AI API (https://www.zhipu.ai/) | ||
ZHIPUAI_API_KEY="Fill your API key here" | ||
ZHIPUAI_API_BASE_URL="Fill your Base URL here" | ||
|
||
# Qwen API (https://help.aliyun.com/document_detail/611472.html) | ||
QWEN_API_KEY="Fill your API key here" | ||
|
||
# LingYi API (https://platform.lingyiwanwu.com/apikeys) | ||
YI_API_KEY="Fill your API key here" | ||
|
||
#=========================================== | ||
# Tools & Services API | ||
#=========================================== | ||
|
||
# Google Search API (https://developers.google.com/custom-search/v1/overview) | ||
GOOGLE_API_KEY="Fill your API key here" | ||
SEARCH_ENGINE_ID="Fill your API key here" | ||
|
||
# OpenWeatherMap API (https://home.openweathermap.org/users/sign_up) | ||
OPENWEATHERMAP_API_KEY="Fill your API key here" | ||
|
||
# NVIDIA API (https://build.nvidia.com/explore/discover) | ||
NVIDIA_API_BASE_URL="Fill your API key here" | ||
NVIDIA_API_KEY="Fill your API key here" | ||
|
||
# Neo4j Database (https://neo4j.com/) | ||
NEO4J_URI="Fill your API key here" | ||
NEO4J_USERNAME="Fill your User Name here" | ||
NEO4J_PASSWORD="Fill your Password here" | ||
|
||
# Firecrawl API (https://www.firecrawl.dev/) | ||
FIRECRAWL_API_KEY="Fill your API key here" | ||
|
||
# AskNews API (https://docs.asknews.app/en/reference) | ||
ASKNEWS_CLIENT_ID="Fill your Client ID here" | ||
ASKNEWS_CLIENT_SECRET="Fill your Client Secret here" | ||
|
||
# Chunkr API (https://chunkr.ai/) | ||
CHUNKR_API_KEY="Fill your API key here" |
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 |
---|---|---|
|
@@ -125,7 +125,6 @@ celerybeat.pid | |
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
|
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# =========== 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 List, Optional | ||
|
||
from camel.configs.base_config import BaseConfig | ||
|
||
|
||
class CohereConfig(BaseConfig): | ||
r"""Defines the parameters for generating chat completions using the | ||
Cohere API. | ||
Args: | ||
temperature (float, optional): Sampling temperature to use, between | ||
:obj:`0` and :obj:`2`. Higher values make the output more random, | ||
while lower values make it more focused and deterministic. | ||
(default: :obj:`0.3`) | ||
documents (list, optional): A list of relevant documents that the | ||
model can cite to generate a more accurate reply. Each document is | ||
either a string or document object with content and metadata. | ||
(default: :obj:`None`) | ||
max_tokens (int, optional): The maximum number of tokens the model | ||
will generate as part of the response. (default: :obj:`None`) | ||
stop_sequences (List(str), optional): A list of up to 5 strings that | ||
the model will use to stop generation. If the model generates a | ||
string that matches any of the strings in the list, it will stop | ||
generating tokens and return the generated text up to that point | ||
not including the stop sequence. (default: :obj:`None`) | ||
seed (int, optional): If specified, the backend will make a best | ||
effort to sample tokens deterministically, such that repeated | ||
requests with the same seed and parameters should return the same | ||
result. However, determinism cannot be totally guaranteed. | ||
(default: :obj:`None`) | ||
frequency_penalty (float, optional): Min value of `0.0`, max value of | ||
`1.0`. Used to reduce repetitiveness of generated tokens. The | ||
higher the value, the stronger a penalty is applied to previously | ||
present tokens, proportional to how many times they have already | ||
appeared in the prompt or prior generation. (default: :obj:`0.0`) | ||
presence_penalty (float, optional): Min value of `0.0`, max value of | ||
`1.0`. Used to reduce repetitiveness of generated tokens. Similar | ||
to `frequency_penalty`, except that this penalty is applied | ||
equally to all tokens that have already appeared, regardless of | ||
their exact frequencies. (default: :obj:`0.0`) | ||
k (int, optional): Ensures only the top k most likely tokens are | ||
considered for generation at each step. Min value of `0`, max | ||
value of `500`. (default: :obj:`0`) | ||
p (float, optional): Ensures that only the most likely tokens, with | ||
total probability mass of `p`, are considered for generation at | ||
each step. If both k and p are enabled, `p` acts after `k`. Min | ||
value of `0.01`, max value of `0.99`. (default: :obj:`0.75`) | ||
""" | ||
|
||
temperature: Optional[float] = 0.2 | ||
documents: Optional[list] = None | ||
max_tokens: Optional[int] = None | ||
stop_sequences: Optional[List[str]] = None | ||
seed: Optional[int] = None | ||
frequency_penalty: Optional[float] = 0.0 | ||
presence_penalty: Optional[float] = 0.0 | ||
k: Optional[int] = 0 | ||
p: Optional[float] = 0.75 | ||
|
||
|
||
COHERE_API_PARAMS = {param for param in CohereConfig().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.