Skip to content

Commit fc4b17a

Browse files
examples: fix E501 and lint issues in enterprise gateway example
- Wrap long strings to satisfy line length - Replace cli_mode usage not supported by Agent ctor - Remove trailing whitespace per pycodestyle Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 7f432ff commit fc4b17a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/01_standalone_sdk/26_enterprise_gateway.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
from pydantic import SecretStr
1414

15-
from openhands.sdk import Agent, Conversation, MessageEvent
16-
from openhands.sdk.llm import LLM, content_to_str
15+
from openhands.sdk import Agent, Conversation
16+
from openhands.sdk.llm import LLM
1717

1818

1919
def build_gateway_llm() -> LLM:
@@ -30,7 +30,8 @@ def build_gateway_llm() -> LLM:
3030
base_url=os.getenv(
3131
"LLM_BASE_URL", "https://your-corporate-proxy.company.com/api/llm"
3232
),
33-
# an api_key input is always required but is unused when api keys are passed via extra headers
33+
# api_key is required as an input
34+
# but unused when API keys are passed via extra headers
3435
api_key=SecretStr(os.getenv("LLM_API_KEY", "placeholder")),
3536
custom_llm_provider=os.getenv("LLM_CUSTOM_LLM_PROVIDER", "openai"),
3637
ssl_verify=ssl_verify,
@@ -58,7 +59,7 @@ def build_gateway_llm() -> LLM:
5859
llm = build_gateway_llm()
5960

6061
# Create agent and conversation
61-
agent = Agent(llm=llm, cli_mode=True)
62+
agent = Agent(llm=llm)
6263
conversation = Conversation(
6364
agent=agent,
6465
workspace=os.getcwd(),
@@ -68,7 +69,8 @@ def build_gateway_llm() -> LLM:
6869
try:
6970
# Send a message to test the enterprise gateway configuration
7071
conversation.send_message(
71-
"Analyze this codebase and create 3 facts about the current project into FACTS.txt. Do not write code."
72+
"Analyze this codebase and create 3 facts about the current project "
73+
"into FACTS.txt. Do not write code."
7274
)
7375
conversation.run()
7476

0 commit comments

Comments
 (0)