Skip to content

Commit 74c59e5

Browse files
authored
chore: release prep
Automated merge for release prep
2 parents e58d92d + 9597719 commit 74c59e5

File tree

8 files changed

+97
-43
lines changed

8 files changed

+97
-43
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ jobs:
144144
kubectl set image -n testnet-dev deployment/intent-tg intent-tg=crestal/intentkit:${VERSION_NO_V}
145145
kubectl set image -n testnet-dev deployment/intent-checker intent-checker=crestal/intentkit:${VERSION_NO_V}
146146
#kubectl set image -n testnet-dev deployment/intent-singleton intent-singleton=crestal/intentkit:${VERSION_NO_V}
147-
kubectl set image -n testnet-dev deployment/sandbox-open sandbox-open=crestal/intentkit:${VERSION_NO_V}
148-
kubectl set image -n testnet-dev deployment/sandbox-autonomous sandbox-autonomous=crestal/intentkit:${VERSION_NO_V}
147+
#kubectl set image -n testnet-dev deployment/sandbox-open sandbox-open=crestal/intentkit:${VERSION_NO_V}
148+
#kubectl set image -n testnet-dev deployment/sandbox-autonomous sandbox-autonomous=crestal/intentkit:${VERSION_NO_V}
149149
150150
- name: Deploy to Amazon EKS Prod
151151
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
@@ -160,8 +160,8 @@ jobs:
160160
kubectl set image -n testnet-prod deployment/intent-tg intent-tg=crestal/intentkit:${VERSION_NO_V}
161161
kubectl set image -n testnet-prod deployment/intent-checker intent-checker=crestal/intentkit:${VERSION_NO_V}
162162
#kubectl set image -n testnet-prod deployment/intent-singleton intent-singleton=crestal/intentkit:${VERSION_NO_V}
163-
kubectl set image -n testnet-prod deployment/sandbox-open sandbox-open=crestal/intentkit:${VERSION_NO_V}
164-
kubectl set image -n testnet-prod deployment/sandbox-autonomous sandbox-autonomous=crestal/intentkit:${VERSION_NO_V}
163+
#kubectl set image -n testnet-prod deployment/sandbox-open sandbox-open=crestal/intentkit:${VERSION_NO_V}
164+
#kubectl set image -n testnet-prod deployment/sandbox-autonomous sandbox-autonomous=crestal/intentkit:${VERSION_NO_V}
165165
166166
- name: Build Success
167167
if: ${{ success() }}

intentkit/core/engine.py

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,29 @@
6767
_agents_updated: dict[str, datetime] = {}
6868

6969

70+
def _extract_text_content(content: object) -> str:
71+
if isinstance(content, list):
72+
texts: list[str] = []
73+
for item in content:
74+
if isinstance(item, dict):
75+
t = item.get("text")
76+
ty = item.get("type")
77+
if t is not None and (ty == "text" or ty is None):
78+
texts.append(t)
79+
elif isinstance(item, str):
80+
texts.append(item)
81+
return "".join(texts)
82+
if isinstance(content, dict):
83+
if content.get("type") == "text" and "text" in content:
84+
return content["text"]
85+
if "text" in content:
86+
return content["text"]
87+
return ""
88+
if isinstance(content, str):
89+
return content
90+
return ""
91+
92+
7093
async def build_agent(
7194
agent: Agent, agent_data: AgentData, custom_skills: list[BaseTool] = []
7295
) -> CompiledStateGraph:
@@ -149,8 +172,8 @@ async def select_model(
149172
if llm_model.info.provider == LLMProvider.OPENAI:
150173
tools.append({"type": "web_search"})
151174
private_tools.append({"type": "web_search"})
152-
if agent.model.startswith("gpt-5-"):
153-
llm_params["reasoning_effort"] = "low"
175+
if llm_model.info.model_name == "gpt-5-mini":
176+
llm_params["reasoning_effort"] = "medium"
154177
if llm_model.info.provider == LLMProvider.XAI:
155178
llm_params["search_parameters"] = {"mode": "auto"}
156179
# TODO: else use a search skill
@@ -431,31 +454,30 @@ async def stream_agent_raw(
431454

432455
# super mode
433456
recursion_limit = 30
434-
if re.search(r"\b@super\b", input_message):
457+
if re.search(r"@super\b", input_message) or user_message.super_mode:
435458
recursion_limit = 300
436459
# Remove @super from the message
437-
input_message = re.sub(r"\b@super\b", "", input_message).strip()
460+
input_message = re.sub(r"@super\b", "", input_message).strip()
438461

439462
# llm native search
440-
search = False
441-
if re.search(r"\b@search\b", input_message) or re.search(
442-
r"\b@web\b", input_message
443-
):
463+
search = user_message.search_mode if user_message.search_mode is not None else False
464+
if re.search(r"@search\b", input_message) or re.search(r"@web\b", input_message):
444465
search = True
445466
if model.supports_search:
446467
input_message = re.sub(
447-
r"\b@search\b",
468+
r"@search\b",
448469
"(You have native search tool, you can use it to get more recent information)",
449470
input_message,
450471
).strip()
451472
input_message = re.sub(
452-
r"\b@web\b",
473+
r"@web\b",
453474
"(You have native search tool, you can use it to get more recent information)",
454475
input_message,
455476
).strip()
456477
else:
457-
input_message = re.sub(r"\b@search\b", "", input_message).strip()
458-
input_message = re.sub(r"\b@web\b", "", input_message).strip()
478+
search = False
479+
input_message = re.sub(r"@search\b", "", input_message).strip()
480+
input_message = re.sub(r"@web\b", "", input_message).strip()
459481

460482
# content to llm
461483
messages = [
@@ -526,16 +548,7 @@ def get_agent() -> Agent:
526548
# tool calls, save for later use, if it is deleted by post_model_hook, will not be used.
527549
cached_tool_step = msg
528550
if hasattr(msg, "content") and msg.content:
529-
content = msg.content
530-
if isinstance(msg.content, list):
531-
# in new version, content item maybe a list
532-
content = msg.content[0]
533-
if isinstance(content, dict):
534-
if "text" in content:
535-
content = content["text"]
536-
else:
537-
content = str(content)
538-
logger.error(f"unexpected content type: {content}")
551+
content = _extract_text_content(msg.content)
539552
# agent message
540553
chat_message_create = ChatMessageCreate(
541554
id=str(XID()),

intentkit/core/prompt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ async def explain_prompt(message: str) -> str:
250250
str: The processed message with @skill patterns replaced
251251
"""
252252
# Pattern to match @skill:category:config_name with word boundaries
253-
pattern = r"\b@skill:([^:]+):([^\s]+)\b"
253+
pattern = r"@skill:([^:]+):([^\s]+)\b"
254254

255255
async def replace_skill_pattern(match):
256256
category = match.group(1)

intentkit/models/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ class AgentPublicInfo(BaseModel):
958958
le=1.0,
959959
json_schema_extra={
960960
"x-placeholder": "Enter agent price",
961+
"x-step": 0.01,
961962
},
962963
),
963964
]

intentkit/models/llm.csv

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ google/gemini-2.5-flash,Gemini 2.5 Flash,gatewayz,FALSE,0.3,2.5,2,1050000,65000,
55
google/gemini-2.5-pro,Gemini 2.5 Pro,gatewayz,FALSE,1.25,10,4,1050000,65000,4,2,TRUE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,FALSE,https://api.gatewayz.ai/v1,300
66
anthropic/claude-sonnet-4.5,Anthropic Claude Sonnet 4.5,gatewayz,FALSE,3,15,5,200000,64000,5,1,TRUE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,FALSE,https://api.gatewayz.ai/v1,300
77
gpt-5-nano,GPT-5 Nano,openai,TRUE,0.05,0.4,1,400000,128000,3,5,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,,180
8-
gpt-5-mini,GPT-5 Mini,openai,TRUE,0.25,2,2,400000,128000,4,4,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,,180
8+
gpt-5-mini,GPT-5 Mini,openai,TRUE,0.25,2,2,400000,128000,4,4,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,,180
99
gpt-5,GPT-5,openai,TRUE,1.25,10,4,400000,128000,5,3,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,,180
10+
gpt-5-codex,GPT-5 Codex,openai,TRUE,1.25,10,4,400000,128000,5,3,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,,180
1011
gpt-4o,GPT-4o,openai,FALSE,2.5,10,4,128000,4096,4,3,TRUE,TRUE,TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,,180
1112
gpt-4o-mini,GPT-4o Mini,openai,FALSE,0.15,0.6,1,128000,4096,3,4,FALSE,TRUE,TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,,180
1213
gpt-4.1-nano,GPT-4.1 Nano,openai,TRUE,0.1,0.4,1,128000,4096,3,5,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,FALSE,,180
@@ -17,7 +18,8 @@ o4-mini,OpenAI o4-mini,openai,TRUE,1.1,4.4,3,128000,4096,4,3,FALSE,TRUE,TRUE,TRU
1718
deepseek-chat,Deepseek V3.2 Exp,deepseek,TRUE,0.28,0.42,2,128000,4096,4,3,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,TRUE,https://api.deepseek.com,300
1819
deepseek-reasoner,DeepSeek V3.2 Exp (Thinking Mode),deepseek,TRUE,0.28,0.42,2,128000,32000,5,1,FALSE,TRUE,TRUE,TRUE,FALSE,TRUE,TRUE,TRUE,https://api.deepseek.com,300
1920
grok-4,Grok 4,xai,TRUE,3,15,4,256000,4096,5,3,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,,180
20-
grok-4-fast-non-reasoning,Grok 4 Fast,xai,TRUE,0.2,0.5,2,2000000,4096,3,4,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,,180
21+
grok-4-fast-non-reasoning,Grok 4 Fast,xai,TRUE,0.2,0.5,2,2000000,4096,3,4,TRUE,TRUE,TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,,180
22+
grok-4-fast-reasoning,Grok 4 Fast Reasoning,xai,TRUE,0.2,0.5,2,2000000,4096,3,4,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,,180
2123
grok-code-fast-1,Grok Code Fast 1,xai,TRUE,0.2,1.5,3,256000,4096,4,4,FALSE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,,180
2224
grok-3,Grok 3,xai,TRUE,3,15,4,131072,4096,5,3,FALSE,TRUE,TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,,180
2325
grok-3-mini,Grok 3 Mini,xai,TRUE,0.3,0.5,2,131072,4096,5,3,FALSE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,,180

intentkit/models/llm.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ async def create_instance(self, params: dict[str, Any] = {}) -> BaseChatModel:
403403
"model_name": self.model_name,
404404
"openai_api_key": config.openai_api_key,
405405
"timeout": info.timeout,
406+
"use_responses_api": True,
406407
}
407408

408409
# Add optional parameters based on model support
@@ -418,10 +419,12 @@ async def create_instance(self, params: dict[str, Any] = {}) -> BaseChatModel:
418419
if info.api_base:
419420
kwargs["openai_api_base"] = info.api_base
420421

421-
if self.model_name.startswith("gpt-5-"):
422+
if self.model_name == "gpt-5-mini" or self.model_name == "gpt-5-nano":
422423
kwargs["reasoning_effort"] = "minimal"
423424
elif self.model_name == "gpt-5":
424-
kwargs["reasoning_effort"] = "low"
425+
kwargs["reasoning_effort"] = "medium"
426+
elif self.model_name == "gpt-5-codex":
427+
kwargs["reasoning_effort"] = "high"
425428

426429
# Update kwargs with params to allow overriding
427430
kwargs.update(params)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from intentkit.core.engine import _extract_text_content
2+
3+
4+
def test_extract_from_list_mixed_types():
5+
content = [
6+
{"id": "rs_x", "summary": [], "type": "reasoning"},
7+
{
8+
"id": "ws_x",
9+
"action": {"query": "q", "type": "search"},
10+
"status": "completed",
11+
"type": "web_search_call",
12+
},
13+
{"type": "text", "text": "Hello"},
14+
{"type": "text", "text": " World"},
15+
]
16+
assert _extract_text_content(content) == "Hello World"
17+
18+
19+
def test_extract_from_dict_text_type():
20+
content = {"type": "text", "text": "ABC"}
21+
assert _extract_text_content(content) == "ABC"
22+
23+
24+
def test_extract_from_dict_with_text_without_type():
25+
content = {"text": "XYZ"}
26+
assert _extract_text_content(content) == "XYZ"
27+
28+
29+
def test_extract_from_dict_without_text():
30+
content = {"type": "reasoning", "summary": []}
31+
assert _extract_text_content(content) == ""
32+
33+
34+
def test_extract_from_string():
35+
assert _extract_text_content("plain") == "plain"

uv.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)