Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions agent_apis/.env.Example
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
OPENAI_API_KEY=<your-openai-api-key>

# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>
# RESTACK_CLOUD_TOKEN=<your-cloud-token>
OPENAI_API_KEY=<your-openai-api-key>
8 changes: 3 additions & 5 deletions agent_apis/src/functions/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ async def llm(function_input: FunctionInputParams) -> str:
try:
log.info("llm function started", input=function_input)

if os.environ.get("RESTACK_API_KEY") is None:
error_message = "RESTACK_API_KEY is not set"
if os.environ.get("OPENAI_API_KEY") is None:
error_message = "OPENAI_API_KEY is not set"
raise_exception(error_message)

client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

messages = []
if function_input.system_content:
Expand Down
9 changes: 1 addition & 8 deletions agent_chat/.env.Example
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_API_ADDRESS=<your-engine-api-address>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>

# RESTACK_API_KEY=<your-api-key>
OPENAI_API_KEY=<your-openai-api-key>
8 changes: 3 additions & 5 deletions agent_chat/src/functions/llm_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ async def llm_chat(agent_input: LlmChatInput) -> dict[str, str]:
try:
log.info("llm_chat function started", agent_input=agent_input)

if os.environ.get("RESTACK_API_KEY") is None:
error_message = "RESTACK_API_KEY is not set"
if os.environ.get("OPENAI_API_KEY") is None:
error_message = "OPENAI_API_KEY is not set"
raise_exception(error_message)

client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

if agent_input.system_content:
agent_input.messages.append(
Expand Down
7 changes: 1 addition & 6 deletions agent_humanloop/.env.Example
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>
# RESTACK_CLOUD_TOKEN=<your-cloud-token>
OPENAI_API_KEY=<your-openai-api-key>
8 changes: 3 additions & 5 deletions agent_rag/src/functions/llm_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ async def llm_chat(function_input: LlmChatInput) -> ChatCompletion:
try:
log.info("llm_chat function started", function_input=function_input)

if os.environ.get("RESTACK_API_KEY") is None:
error_message = "RESTACK_API_KEY is not set"
if os.environ.get("OPENAI_API_KEY") is None:
error_message = "OPENAI_API_KEY is not set"
raise_exception(error_message)

client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

if function_input.system_content:
function_input.messages.append(
Expand Down
9 changes: 1 addition & 8 deletions agent_stream/.env.Example
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_API_ADDRESS=<your-engine-api-address>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>

# RESTACK_API_KEY=<your-api-key>
OPENAI_API_KEY=<your-openai-api-key>
4 changes: 1 addition & 3 deletions agent_stream/src/functions/llm_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class LlmChatInput(BaseModel):
@function.defn()
async def llm_chat(function_input: LlmChatInput) -> str:
try:
client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

if function_input.system_content:
# Insert the system message at the beginning
Expand Down
13 changes: 1 addition & 12 deletions agent_telephony/twilio_livekit/agent_twilio/.env.Example
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

RESTACK_API_KEY=
OPENAI_API_KEY=

LIVEKIT_API_KEY=
Expand All @@ -15,13 +13,4 @@ ELEVEN_API_KEY=
DEEPGRAM_API_KEY=
OPENAI_API_KEY=

GCP_CREDENTIALS=

# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_API_ADDRESS=<your-engine-api-address>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>


GCP_CREDENTIALS=
14 changes: 2 additions & 12 deletions agent_telephony/vapi/agent_vapi/.env.Example
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@

RESTACK_API_KEY=
VAPI_TOKEN=

# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_API_ADDRESS=<your-engine-api-address>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>


OPENAI_API_KEY=
VAPI_TOKEN=
4 changes: 1 addition & 3 deletions agent_telephony/vapi/agent_vapi/src/functions/llm_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class LlmChatInput(BaseModel):
@function.defn()
async def llm_chat(function_input: LlmChatInput) -> str:
try:
client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

if function_input.system_content:
# Insert the system message at the beginning
Expand Down
8 changes: 1 addition & 7 deletions agent_todo/.env.Example
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_API_ADDRESS=<your-engine-api-address>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>
# RESTACK_CLOUD_TOKEN=<your-cloud-token>
OPENAI_API_KEY=<your-openai-api-key>
4 changes: 1 addition & 3 deletions agent_todo/src/functions/llm_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ async def llm_chat(function_input: LlmChatInput) -> ChatCompletion:
if os.environ.get("RESTACK_API_KEY") is None:
raise_exception("RESTACK_API_KEY is not set")

client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

log.info("pydantic_function_tool", tools=function_input.tools)

Expand Down
8 changes: 3 additions & 5 deletions agent_tool/src/functions/llm_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ async def llm_chat(function_input: LlmChatInput) -> ChatCompletion:
try:
log.info("llm_chat function started", function_input=function_input)

if os.environ.get("RESTACK_API_KEY") is None:
raise_exception("RESTACK_API_KEY is not set")
if os.environ.get("OPENAI_API_KEY") is None:
raise_exception("OPENAI_API_KEY is not set")

client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

log.info("pydantic_function_tool", tools=function_input.tools)

Expand Down
4 changes: 1 addition & 3 deletions agent_video/src/functions/llm_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class LlmChatInput(BaseModel):
@function.defn()
async def llm_chat(function_input: LlmChatInput) -> str:
try:
client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

if function_input.system_content:
# Insert the system message at the beginning
Expand Down
10 changes: 1 addition & 9 deletions agent_voice/livekit/agent/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
RESTACK_API_KEY=
LIVEKIT_API_KEY=
LIVEKIT_API_SECRET=
LIVEKIT_URL="wss://XXXXlivekit.cloud"
Expand All @@ -10,11 +9,4 @@ TWILIO_TRUNK_AUTH_PASSWORD=

ELEVEN_API_KEY=
DEEPGRAM_API_KEY=
OPENAI_API_KEY=

# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_API_ADDRESS=<your-engine-api-address>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>
OPENAI_API_KEY=
4 changes: 1 addition & 3 deletions agent_voice/livekit/agent/src/functions/llm_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class LlmChatInput(BaseModel):
@function.defn()
async def llm_chat(function_input: LlmChatInput) -> str:
try:
client = OpenAI(
base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY")
)
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

if function_input.system_content:
# Insert the system message at the beginning
Expand Down
9 changes: 1 addition & 8 deletions agent_voice/livekit/livekit_pipeline/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,4 @@ LIVEKIT_API_SECRET=

OPENAI_API_KEY=
DEEPGRAM_API_KEY=
CARTESIA_API_KEY=

# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_API_ADDRESS=<your-engine-api-address>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>
CARTESIA_API_KEY=
7 changes: 1 addition & 6 deletions encryption/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>
# RESTACK_CLOUD_TOKEN=<your-cloud-token>
OPENAI_API_KEY=<your-openai-api-key>
10 changes: 1 addition & 9 deletions pdf_ocr/.env.Example
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@

OPENAI_API_KEY=<your-openai-api-key>

# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>
# RESTACK_CLOUD_TOKEN=<your-cloud-token>
OPENAI_API_KEY=<your-openai-api-key>
6 changes: 3 additions & 3 deletions pdf_ocr/src/functions/openai_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ async def openai_chat(input: OpenAiChatInput) -> str:
try:
log.info("openai_chat function started", input=input)

if (os.environ.get("RESTACK_API_KEY") is None):
raise NonRetryableError("RESTACK_API_KEY is not set")
if (os.environ.get("OPENAI_API_KEY") is None):
raise NonRetryableError("OPENAI_API_KEY is not set")

client = OpenAI(base_url="https://ai.restack.io", api_key=os.environ.get("RESTACK_API_KEY"))
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

messages = []
if input.system_content:
Expand Down
7 changes: 1 addition & 6 deletions production_demo/.env.Example
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
# Restack Cloud (Optional)

# RESTACK_ENGINE_ID=<your-engine-id>
# RESTACK_ENGINE_API_KEY=<your-engine-api-key>
# RESTACK_ENGINE_ADDRESS=<your-engine-address>
# RESTACK_ENGINE_API_ADDRESS=<your-engine-api-address>
OPENAI_API_KEY=<your-openai-api-key>