§
    ØŽ’j¬7  ã                   ó¶   — d Z ddlmZmZmZ ddlmZ  G d„ de¦  «        Z G d„ de¦  «        Z G d	„ d
e¦  «        Z	 G d„ de¦  «        Z
 G d„ de¦  «        ZdS )zThe agent config classes.é    )Ú	BaseModelÚFieldÚfield_validatoré   )ÚChatModelBasec                   ó¾   — e Zd ZU dZ ed¬¦  «        Zeed<    ed¬¦  «        Zeed<    ed¬¦  «        Z	eed<    ed	¬¦  «        Z
eed
<    ed¬¦  «        Zeed<   dS )ÚSummarySchemazEThe compressed memory model, used to generate summary of old memoriesz^The user's core request and success criteria.
Any clarifications or constraints they specified)ÚdescriptionÚtask_overviewz€What has been completed so far.
File created, modified, or analyzed (with paths if relevant).
Key outputs or artifacts produced.Úcurrent_statez¹Technical constraints or requirements uncovered.
Decisions made and their rationale.
Errors encountered and how they were resolved.
What approaches were tried that didn't work (and why)Úimportant_discoveriesz€Specific actions needed to complete the task.
Any blockers or open questions to resolve.
Priority order if multiple steps remainÚ
next_stepszrUser preferences or style requirements.
Domain-specific details that aren't obvious.
Any promises made to the userÚcontext_to_preserveN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚstrÚ__annotations__r   r   r   r   © ó    úFC:\Projects\DSCons\.venv\Lib\site-packages\agentscope\agent\_config.pyr	   r	   	   s  € € € € € € ØOÐOà˜ð?ðñ ô €M�3ð ð ñ ð ˜ð1ðñ ô €M�3ð ð ñ ð "' ðDð"ñ "ô "Ð˜3ð ð ñ ð �eð6ðñ ô €J�ð ð ñ ð  %˜uð,ð ñ  ô  Ð˜ð ð ñ ðKð Kr   r	   c                   ó  — e Zd ZU dZddiZ	  eddd¬¦  «        Zeed<   	  ed	dd¬¦  «        Z	eed
<   	  edddi¬¦  «        Z
eed<   	  edddi¬¦  «        Zeed<   	  eej        ¬¦  «        Zeed<   	  eddd¬¦  «        Zeed<   dS )ÚContextConfigz/The context related configuration in AgentScopeÚarbitrary_types_allowedTgš™™™™™é?r   gÍÌÌÌÌÌì?)ÚdefaultÚgtÚltÚtrigger_ratiogš™™™™™¹?Úreserve_ratiou=  <system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.
The current time is {current_time}.
This summary may itself be summarized again later, and the conversation history it refers to will be gone, so every reference must be self-contained â€” resolve anything that depends on the vanished context into an absolute, fully-qualified form:
- Time: convert relative expressions ('today', 'now', 'yesterday', 'tomorrow', 'recently') to absolute dates using the current time above; re-anchor them even if an earlier summary already wrote them relatively.
- Names & pointers: use file paths, symbol names, PR/issue numbers, IDs, URLs, and exact commands/error strings verbatim instead of 'this file', 'the above', 'the second approach', 'the 5 failing tests'.
- In-flight work: record everything still pending, especially tools launched in the background whose results you are still waiting on â€” give each one's id and a short note of what it is doing â€” and mark each item's owner (user request vs your own decision) and status (done / pending / blocked).
</system-hint>ÚformatÚtextarea)r   Újson_schema_extraÚcompression_promptzü<system-info>Here is a summary of your previous work
# Task Overview
{task_overview}

# Current State
{current_state}

# Important Discoveries
{important_discoveries}

# Next Steps
{next_steps}

# Context to Preserve
{context_to_preserve}</system-info>Úsummary_template)Údefault_factoryÚsummary_schemazTool Result LimitiPÃ  zaThe maximum length of the tool results in tokens. If exceeded, the tool result will be truncated.©Útitler   r
   Útool_result_limitN)r   r   r   r   Úmodel_configr   r   Úfloatr   r    r$   r   r%   r	   Úmodel_json_schemar'   Údictr*   Úintr   r   r   r   r   3   s\  € € € € € € Ø9Ð9à-¨tÐ4€LØ6à ˜5¨°°sÐ;Ñ;Ô;€M�5Ð;Ð;Ñ;ð!ð !˜5¨°°sÐ;Ñ;Ô;€M�5Ð;Ð;Ñ;ð*ð $˜eðð< $ ZÐ0ðA!ñ !ô !Ð˜ð !ð !ñ !ðD0ð "˜Eðð $ ZÐ0ðñ ô Ð�cð ð ñ ð"ð !˜5Ø%Ô7ðñ ô €N�Dð ð ñ ð&ð #˜UØ!Øð>ð	ñ ô Ð�sð ð ñ ð ?Ð>r   r   c                   ó  — e Zd ZU dZ eddd¬¦  «        Zeed<   	  eddd	¬
¦  «        Ze	ed<   	  eddd¬
¦  «        Z
e	ed<   	  edddd¬¦  «        Zeed<   	  eddddd¬¦  «        Zeed<   	  eddd¬
¦  «        Ze	ed<   	  ed¦  «        ed e	d!e	fd"„¦   «         ¦   «         Z ed#d$d%¬
¦  «        Ze	ed&<   	  ed'd(„ d)¬*¦  «        Zee	         ed+<   	  ed,ed-¬*¦  «        Zee	e	f         ed.<   	  ed/dd0¬
¦  «        Zeed1<   d2S )3ÚInjectionConfigz8The state injection related configuration in AgentScope.zInject Runtime Statez]Inject the runtime state to context, including current time,tasks state, context length, etc.T)r)   r
   r   Úinject_runtime_stateÚTimezoneÚUTCzBThe injected timezone. e.g. 'America/New_York' or 'Asia/Shanghai'.r(   ÚtimezonezTime Formatz%Y-%m-%dT%H:%M:%SzûThe format to inject and parse the time information, which must round-trip a full timestamp, i.e. carry the date part. A time-only format such as '%H:%M:%S' makes the parsed time fall back to year 1900, so that the time is injected in every iteration.Útime_formatzTime Intervalg      à?r   zXThe minimum time interval in hours from the last injection to trigger new time injection)r)   r   Úger
   Útime_intervalzContext Buffergš™™™™™É?é   zšThe buffer that will activate context length injection before context compression, which should be smaller than the 'trigger_ratio' of the context config.)r)   r   r7   Úler
   Úcontext_buffer_ratioÚTemplatezÖ<system-reminder>Treat the following as the ground truth at this point of the conversation. Anything stated earlier is outdated, and a later reminder, if any, supersedes this one:
{runtime_state}
</system-reminder>z�The template to wrap the injected runtime state, where the '{runtime_state}' placeholder will be replaced by the injected fields.ÚtemplateÚvalueÚreturnc                 ó4   — d|vrt          d|›d�¦  «        ‚|S )z<Ensure the template won't silently drop the injected fields.z{runtime_state}zKThe injection template must contain the '{runtime_state}' placeholder, got ú.)Ú
ValueError)Úclsr>   s     r   Ú_check_templatezInjectionConfig._check_templateà   s?   € ð  EÐ)Ð)Ýð/Ø$)ð/ð /ð /ñô ð ð ˆr   zInjection Sourcez0{"label": "System", "sublabel": "Runtime State"}zqThe source of the injected hint block, which is also used to identify the previous injections within the context.Úinjection_sourcezTask Tool Namesc                  ó
   — g d¢S )N)Ú
TaskCreateÚTaskGetÚTaskListÚ
TaskUpdater   r   r   r   ú<lambda>zInjectionConfig.<lambda>ø   s   € ð !
ð !
ð !
€ r   zbThe names of the task related tools. Their presence in the context suppresses the tasks injection.)r)   r&   r
   Útask_tool_nameszExtra Fieldsz[The extra fields to inject, which will be wrapped into the '<{key}>{value}</{key}>' format.Úextra_fieldszEmit Hint Eventz@If emit the HintBlockEvent when runtime state injection happens.Úemit_hint_eventN)r   r   r   r   r   r2   Úboolr   r5   r   r6   r8   r,   r;   r=   r   ÚclassmethodrD   rE   rL   Úlistr.   rM   rN   r   r   r   r1   r1   Ž   sµ  € € € € € € ØBÐBà!& Ø$ð0ð ð"ñ "ô "Ð˜$ð ð ñ ð)ð �EØØðð	ñ ô €Hˆcð ð ñ ðDð �uØØ#ðð	
ñ 
ô 
€K�ð 
ð 
ñ 
ð5ð !˜5ØØØð)ðñ ô €M�5ð ð ñ ðð #( %ØØØØð5ð
#ñ 
#ô 
#Ð˜%ð 
ð 
ñ 
ð4ð �EØðððñ ô €Hˆcð ð ñ ð(ð €_�ZÑ Ô Øð Cð ¨Cð ð ð ñ „[ñ !Ô ðð "˜EØ ØBðCð	ñ ô Ð�cð ð ñ ð-ð "' Øð
ð 
ð6ð"ñ "ô "€O�T˜#”Yð ð ñ ð9ð $) 5ØØð/ð	$ñ $ô $€L�$�s˜C�x”.ð ð ñ ð-ð "˜EØØàNð	ñ ô €O�Tð ð ñ ð ð r   r1   c                   óÜ   — e Zd ZU dZ eddd¬¦  «        Zeed<   	  eddd	d
¬¦  «        Zeed<   	  eddd¬¦  «        Z	e
ed<   	  eddd¬¦  «        Zeed<   	  eddd¬¦  «        Ze
ed<   dS )ÚReActConfigz#The reasoning related configurationzMax Iterationsé   z>The maximum number of reasoning-acting iterations in one replyr(   Ú	max_itersz!Grace Iters for Structured OutputzLThe grace iterations for structured output when exceeding the max iterationsé   r   )r)   r
   r   r   Ústructured_output_grace_iterszRejection HandlingFz>Whether to stop replying when being rejected to execute tools.Ústop_on_rejectzInterruption Messagez.I notice the interruption. How can I help you?z)The quick reply message when interrupted.Úinterruption_messagez$Raise CancelledError on Interruptionz´Whether to re-raise ``asyncio.CancelledError`` after handling the interruption. When ``False``, the ``CancelledError`` is swallowed once the interruption context has been produced.Ú"interruption_raise_cancelled_errorN)r   r   r   r   r   rU   r/   r   rW   rX   rO   rY   r   rZ   r   r   r   rS   rS     s6  € € € € € € Ø-Ð-à�UØØððñ ô €Iˆsð ð ñ ð Jà).¨Ø1ðð Øð*ñ *ô *Ð! 3ð ð ñ ð#ð !˜5Ø"Øððñ ô €N�Dð ð ñ ðð !& Ø$Ø@Ø?ð!ñ !ô !Ð˜#ð ð ñ ð
 $à/4¨uØ4ØðHð0ñ 0ô 0Ð&¨ð ð ñ ð,ð ,r   rS   c                   ón   — e Zd ZU dZddiZ eddd¬¦  «        Zeed<   	  edd	¬
¦  «        Z	e
dz  ed<   dS )ÚModelConfigz The model related configuration.r   Tr   a+  Number of retries on top of the initial call before falling over to the fallback model. ``0`` means call the model exactly once and immediately move to the fallback on failure. Same semantics as ``ChatModelBase.max_retries``. Defaults to 0 to avoid compounding with the model's own inner retry loop.)r   r7   r
   Úmax_retriesNz2The fallback model used when the main model fails.)r   r
   Úfallback_model)r   r   r   r   r+   r   r]   r/   r   r^   r   r   r   r   r\   r\   O  s”   € € € € € € Ø*Ð*ð .¨tÐ4€Là�uØØðGð	
ñ 
ô 
€K�ð 
ð 
ñ 
ð?ð ,1¨5ØØHð,ñ ,ô ,€N�M DÑ(ð ð ñ ðð r   r\   N)r   Úpydanticr   r   r   Úmodelr   r	   r   r1   rS   r\   r   r   r   ú<module>ra      s3  ðà Ð à 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6à !Ð !Ð !Ð !Ð !Ð !ð'Kð 'Kð 'Kð 'Kð 'K�Iñ 'Kô 'Kð 'KðTX?ð X?ð X?ð X?ð X?�Iñ X?ô X?ð X?ðvIð Ið Ið Ið I�iñ Iô Ið IðX2,ð 2,ð 2,ð 2,ð 2,�)ñ 2,ô 2,ð 2,ðjð ð ð ð �)ñ ô ð ð ð r   