Skip to content

Commit

Permalink
update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Jan 26, 2024
1 parent 8abebea commit bf7eb1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions posthog/hogql/ai.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import TYPE_CHECKING, Optional
from openai import OpenAI
import openai
from openai.types.chat import ChatCompletionMessageParam
from posthog.event_usage import report_user_action
from posthog.hogql.context import HogQLContext
Expand Down Expand Up @@ -102,7 +102,7 @@ def write_sql_from_prompt(prompt: str, *, current_query: Optional[str] = None, t
prompt_tokens_total, completion_tokens_total = 0, 0
for _ in range(3): # Try up to 3 times in case the generated SQL is not valid HogQL
attempt_count += 1
result = OpenAI().chat.completions.create(
result = openai.chat.completions.create(
model="gpt-3.5-turbo",
temperature=0.8,
messages=messages,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from typing import List, Dict, Any

from openai import OpenAI
import openai

from prometheus_client import Histogram

Expand Down Expand Up @@ -291,7 +291,7 @@ def summarize_recording(recording: SessionRecording, user: User, team: Team):
instance_region = get_instance_region() or "HOBBY"

with timer("openai_completion"):
result = OpenAI().chat.completions.create(
result = openai.chat.completions.create(
# model="gpt-4-1106-preview", # allows 128k tokens
model="gpt-4", # allows 8k tokens
temperature=0.7,
Expand Down

0 comments on commit bf7eb1f

Please sign in to comment.