Skip to content

Commit

Permalink
feat(models): add new openai models
Browse files Browse the repository at this point in the history
  • Loading branch information
jalexanderII committed Sep 12, 2024
1 parent b1cb7be commit feeec14
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cookbook/openai/tracing_with_openai_with_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import json
import os

import openai
import requests
from dotenv import load_dotenv
from openai import OpenAI

from parea import Parea, get_current_trace_id, trace
from parea.schemas import FeedbackRequest
Expand All @@ -14,7 +14,7 @@

API_KEY = os.getenv("GOOGLE_PLACES_API_KEY")
PLACES_URL = "https://maps.googleapis.com/maps/api/place/nearbysearch/json"
openai.api_key = os.getenv("OPENAI_API_KEY")
openai = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

p = Parea(api_key=os.getenv("PAREA_API_KEY"))
p.wrap_openai_client(openai)
Expand Down
40 changes: 40 additions & 0 deletions parea/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,26 @@ def str2bool(v):
"completion": 10.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
"o1-preview": {
"prompt": 15.0,
"completion": 60.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
"o1-preview-2024-09-12": {
"prompt": 15.0,
"completion": 60.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
"o1-mini": {
"prompt": 3.0,
"completion": 12.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
"o1-mini-2024-09-12": {
"prompt": 3.0,
"completion": 12.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
}
AZURE_MODEL_INFO: Dict[str, Dict[str, Union[float, int, Dict[str, int]]]] = {
"gpt-35-turbo": {
Expand Down Expand Up @@ -268,6 +288,26 @@ def str2bool(v):
"completion": 15.0,
"token_limit": {"max_completion_tokens": 4096, "max_prompt_tokens": 128000},
},
"o1-preview": {
"prompt": 15.0,
"completion": 60.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
"o1-preview-2024-09-12": {
"prompt": 15.0,
"completion": 60.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
"o1-mini": {
"prompt": 3.0,
"completion": 12.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
"o1-mini-2024-09-12": {
"prompt": 3.0,
"completion": 12.0,
"token_limit": {"max_completion_tokens": 16384, "max_prompt_tokens": 128000},
},
}

instant_pricing = {"prompt": 1.63, "completion": 5.51}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "parea-ai"
packages = [{ include = "parea" }]
version = "0.2.214"
version = "0.2.215"
description = "Parea python sdk"
readme = "README.md"
authors = ["joel-parea-ai <joel@parea.ai>"]
Expand Down

0 comments on commit feeec14

Please sign in to comment.