
    Ájm                       d dl mZ d dlmZmZmZmZ d dlmZ d dlm	Z	 d dl
Z
ddlmZ ddlmZmZmZmZmZmZmZ dd	lmZmZmZmZmZ dd
lmZ ddlmZmZ ddl m!Z!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddgZ6 G d de      Z7 G d de      Z8 G d d      Z9 G d d      Z: G d d      Z; G d d       Z<y)!    )annotations)ListUnionIterableOptional)datetime)chainN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)is_givenpath_templatemaybe_transformstrip_not_givenasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPageCursorAsyncPageCursor)dream_list_paramsdream_create_params)AsyncPaginatormake_request_options)	BetaDream)AnthropicBetaParam)BetaDreamStatus)BetaDreamInputParam)BetaOutputBehaviorParamDreamsAsyncDreamsc                  P   e Zd Zedd       Zedd       Zeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z
eddded	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r(   c                    t        |       S a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
        )DreamsWithRawResponseselfs    F/tmp/pip-target-k_scjv0h/lib/python/anthropic/resources/beta/dreams.pywith_raw_responsezDreams.with_raw_response   s     %T**    c                    t        |       S z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
        )DreamsWithStreamingResponser.   s    r0   with_streaming_responsezDreams.with_streaming_response(   s     +400r2   Ninstructionsoutput_behaviorbetasextra_headersextra_query
extra_bodytimeoutc       	   
     *   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        ||||dt        j                        t        ||||	      t              S )	  
        Create a Dream

        Args:
          model: Model identifier and configuration applied to every pipeline stage.

          output_behavior: The default destination: the job creates a new output memory store as a clone of
              the memory_store input and writes the consolidated memories into it. The input
              store is never mutated.

          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        anthropic-beta,c              3  2   K   | ]  }t        |        y wNstr.0es     r0   	<genexpr>z Dreams.create.<locals>.<genexpr>W        5Lc!f5L   dreaming-2026-04-21/v1/dreams?beta=trueinputsmodelr8   r9   r;   r<   r=   r>   bodyoptionscast_to)r   r   joinr	   r   _postr   r    DreamCreateParamsr"   r#   
r/   rP   rQ   r8   r9   r:   r;   r<   r=   r>   s
             r0   createzDreams.create1   s    F	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZzz" $"$0'6	 $55 )+Q[el   
 	
r2   r:   r;   r<   r=   r>   c          
     $   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	      S )
  
        Get a Dream

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        7Expected a non-empty value for `dream_id` but received rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   z"Dreams.retrieve.<locals>.<genexpr>   rK   rL   rM   /v1/dreams/{dream_id}?beta=truedream_idrR   rU   rV   

ValueErrorr   r   rW   r	   r   _getr   r"   r#   r/   rc   r:   r;   r<   r=   r>   s          r0   retrievezDreams.retrievep   s    4 VW_Vbcdd	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZyy;hO(+Q[el   
 	
r2   created_at_gtcreated_at_ltinclude_archivedlimitpagestatusesr:   r;   r<   r=   r>   c               F   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        t           t        ||	|
|t        ||||||dt        j                              t              S )	  
        List Dreams

        Args:
          created_at_gt: Return dreams with `created_at` strictly after this timestamp (exclusive lower
              bound, RFC 3339). Unset applies no lower bound.

          created_at_lt: Return dreams with `created_at` strictly before this timestamp (exclusive upper
              bound, RFC 3339). Unset applies no upper bound.

          include_archived: Query parameter for include_archived

          limit: Query parameter for limit

          page: Query parameter for page

          statuses: Filter by lifecycle status. Repeat the parameter to match any of multiple
              statuses. Empty applies no status filter.

          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   zDreams.list.<locals>.<genexpr>   rK   rL   rM   rN   rk   rl   rm   rn   ro   rp   r;   r<   r=   r>   queryro   rU   rQ   )r   r   rW   r	   r   _get_api_listr   r#   r"   r   r   DreamListParamsr/   rk   rl   rm   rn   ro   rp   r:   r;   r<   r=   r>   s               r0   listzDreams.list   s    \	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZ!!"	*(+'%%)6)6,<!& $$, &55
" ) " 
 	
r2   c          
     $   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	      S )
  
        Archive a Dream

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r_   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   z!Dreams.archive.<locals>.<genexpr>  rK   rL   rM   '/v1/dreams/{dream_id}/archive?beta=truerb   rR   rd   
rf   r   r   rW   r	   r   rX   r   r"   r#   rh   s          r0   archivezDreams.archive   s    4 VW_Vbcdd	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZzzChW(+Q[el   
 	
r2   c          
     $   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	      S )
  
        Cancel a Dream

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r_   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   z Dreams.cancel.<locals>.<genexpr>=  rK   rL   rM   &/v1/dreams/{dream_id}/cancel?beta=truerb   rR   rd   r   rh   s          r0   cancelzDreams.cancel  s    4 VW_Vbcdd	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZzzBXV(+Q[el   
 	
r2   )returnr-   )r   r5   rP   zIterable[BetaDreamInputParam]rQ   zdream_create_params.Modelr8   zOptional[str] | Omitr9   zBetaOutputBehaviorParam | Omitr:   List[AnthropicBetaParam] | Omitr;   Headers | Noner<   Query | Noner=   Body | Noner>   'float | httpx.Timeout | None | NotGivenr   r#   rc   rF   r:   r   r;   r   r<   r   r=   r   r>   r   r   r#   )rk   Union[str, datetime] | Omitrl   r   rm   bool | Omitrn   
int | Omitro   
str | Omitrp   List[BetaDreamStatus] | Omitr:   r   r;   r   r<   r   r=   r   r>   r   r   zSyncPageCursor[BetaDream]__name__
__module____qualname__r   r1   r6   r   r   r[   ri   r{   r   r    r2   r0   r(   r(      sq   + + 1 1 .2:>15 )-$("&;D=
 .=
 )	=

 +=
 8=
 /=
 &=
 "=
  =
 9=
 
=
F 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
d 6:59(, 1515 )-$("&;DN
 3N
 3	N

 &N
 N
 N
 /N
 /N
 &N
 "N
  N
 9N
  
#!N
h 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
f 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
r2   c                  P   e Zd Zedd       Zedd       Zeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z
eddded	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r)   c                    t        |       S r,   )AsyncDreamsWithRawResponser.   s    r0   r1   zAsyncDreams.with_raw_responseO  s     *$//r2   c                    t        |       S r4   ) AsyncDreamsWithStreamingResponser.   s    r0   r6   z#AsyncDreams.with_streaming_responseY  s     055r2   Nr7   c       	   
     Z  K   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        ||||dt        j                         d{   t        ||||	      t        	       d{   S 7 $7 w)
r@   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   z%AsyncDreams.create.<locals>.<genexpr>  rK   rL   rM   rN   rO   NrR   rS   )r   r   rW   r	   r   rX   r   r    rY   r"   r#   rZ   s
             r0   r[   zAsyncDreams.createb  s     F	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZZZ",$"$0'6	 $55  )+Q[el    
 
 	

s$   B B+B'
B+"B)#B+)B+r\   c          
     @  K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	       d
{   S 7 w)r^   r_   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   z'AsyncDreams.retrieve.<locals>.<genexpr>  rK   rL   rM   ra   rb   rR   rd   Nre   rh   s          r0   ri   zAsyncDreams.retrieve  s     4 VW_Vbcdd	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZYY;hO(+Q[el   
 
 	
 
   BBBBrj   c               F   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        t           t        ||	|
|t        ||||||dt        j                              t              S )	rr   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   z#AsyncDreams.list.<locals>.<genexpr>  rK   rL   rM   rN   rt   ru   rw   )r   r   rW   r	   r   rx   r   r#   r"   r   r   ry   rz   s               r0   r{   zAsyncDreams.list  s    \	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZ!!" +(+'%%)6)6,<!& $$, &55
" ) " 
 	
r2   c          
     @  K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	       d
{   S 7 w)r}   r_   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   z&AsyncDreams.archive.<locals>.<genexpr>?  rK   rL   rM   r   rb   rR   rd   Nr   rh   s          r0   r   zAsyncDreams.archive   s     4 VW_Vbcdd	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZZZChW(+Q[el    
 
 	
 
r   c          
     @  K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	       d
{   S 7 w)r   r_   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r0   rJ   z%AsyncDreams.cancel.<locals>.<genexpr>n  rK   rL   rM   r   rb   rR   rd   Nr   rh   s          r0   r   zAsyncDreams.cancelO  s     4 VW_Vbcdd	
$ '*hhu5Le5LOdNe/f&g"	
 "	
 *+@Z]EXVXZZZBXV(+Q[el    
 
 	
 
r   )r   r   )r   r   r   r   )rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r:   r   r;   r   r<   r   r=   r   r>   r   r   z5AsyncPaginator[BetaDream, AsyncPageCursor[BetaDream]]r   r   r2   r0   r)   r)   N  sq   0 0 6 6 .2:>15 )-$("&;D=
 .=
 )	=

 +=
 8=
 /=
 &=
 "=
  =
 9=
 
=
F 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
d 6:59(, 1515 )-$("&;DN
 3N
 3	N

 &N
 N
 N
 /N
 /N
 &N
 "N
  N
 9N
  
?!N
h 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
f 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
r2   c                      e Zd ZddZy)r-   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rD   )_dreamsr   to_raw_response_wrapperr[   ri   r{   r   r   r/   dreamss     r0   __init__zDreamsWithRawResponse.__init__  s    &>>MM
 )@@OO
 %<<KK
	 (??NN
 '>>MM
r2   Nr   r(   r   Noner   r   r   r   r   r2   r0   r-   r-         
r2   r-   c                      e Zd ZddZy)r   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rD   )r   r   async_to_raw_response_wrapperr[   ri   r{   r   r   r   s     r0   r   z#AsyncDreamsWithRawResponse.__init__  s    &DDMM
 )FFOO
 %BBKK
	 (EENN
 'DDMM
r2   Nr   r)   r   r   r   r   r2   r0   r   r     r   r2   r   c                      e Zd ZddZy)r5   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y rD   )r   r   r[   ri   r{   r   r   r   s     r0   r   z$DreamsWithStreamingResponse.__init__  sp    2MM
 5OO
 1KK
	 4NN
 3MM
r2   Nr   r   r   r2   r0   r5   r5     r   r2   r5   c                      e Zd ZddZy)r   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y rD   )r   r   r[   ri   r{   r   r   r   s     r0   r   z)AsyncDreamsWithStreamingResponse.__init__  sp    8MM
 ;OO
 7KK
	 :NN
 9MM
r2   Nr   r   r   r2   r0   r   r     r   r2   r   )=
__future__r   typingr   r   r   r   r   	itertoolsr	   httpx r   _typesr   r   r   r   r   r   r   _utilsr   r   r   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   
types.betar   r    _base_clientr!   r"   types.beta.beta_dreamr#   types.anthropic_beta_paramr$   types.beta.beta_dream_statusr%   !types.beta.beta_dream_input_paramr&   %types.beta.beta_output_behavior_paramr'   __all__r(   r)   r-   r   r5   r   r   r2   r0   <module>r      s    # 2 2      K K K f f & : Y 9 @ @ . < ; D L]
#n
_ n
b	n
" n
b	
 
*
 
*
 
*
 
r2   