§
    ZøÁiŠŠ  ã                  ó¢  — d dl mZ d dlmZ d dlmZmZ d dlZddlm	Z	 ddl
mZ ddlmZmZmZmZmZ dd	l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  ddl!m"Z"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+ ddgZ, G d„ de¦  «        Z- G d„ de¦  «        Z. G d„ d¦  «        Z/ G d„ d¦  «        Z0 G d„ d¦  «        Z1 G d„ d¦  «        Z2dS )é    )Úannotations)ÚList)ÚLiteralÚoverloadNé   )Ú_legacy_response)Úcompletion_create_params)Ú	NOT_GIVENÚBodyÚQueryÚHeadersÚNotGiven)Úis_givenÚrequired_argsÚmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚDEFAULT_TIMEOUT)ÚStreamÚAsyncStream)Úmake_request_options)Ú
Completion)Ú
ModelParam)ÚMetadataParamÚCompletionsÚAsyncCompletionsc                  ó  — e Zd Zed.d„¦   «         Zed/d„¦   «         Zeeeeeeedddedœ
d0d"„¦   «         Zeeeeeeddded#œ	d1d&„¦   «         Zeeeeeeddded#œ	d2d)„¦   «         Z e	g d*¢g d+¢¦  «        eeeeeedddedœ
d3d-„¦   «         ZdS )4r   ÚreturnÚCompletionsWithRawResponsec                ó    — t          | ¦  «        S ©a  
        This property can be used as a prefix for any HTTP method call to return the
        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
        )r#   ©Úselfs    úi/var/www/html/jarvis.com/web/backend/venv/lib/python3.11/site-packages/anthropic/resources/completions.pyÚwith_raw_responsezCompletions.with_raw_response!   s   € õ *¨$Ñ/Ô/Ð/ó    Ú CompletionsWithStreamingResponsec                ó    — 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
        )r+   r&   s    r(   Úwith_streaming_responsez#Completions.with_streaming_response+   s   € õ 0°Ñ5Ô5Ð5r*   N©
ÚmetadataÚstop_sequencesÚstreamÚtemperatureÚtop_kÚtop_pÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚmax_tokens_to_sampleÚintÚmodelr   ÚpromptÚstrr0   úMetadataParam | NotGivenr1   úList[str] | NotGivenr2   úLiteral[False] | NotGivenr3   úfloat | NotGivenr4   úint | NotGivenr5   r6   úHeaders | Noner7   úQuery | Noner8   úBody | Noner9   ú'float | httpx.Timeout | None | NotGivenr   c               ó   — dS ©a[  [Legacy] Create a Text Completion.

        The Text Completions API is a legacy API.

        We recommend using the
        [Messages API](https://docs.anthropic.com/en/api/messages) going forward.

        Future models and features will not be compatible with Text Completions. See our
        [migration guide](https://docs.anthropic.com/en/api/migrating-from-text-completions-to-messages)
        for guidance in migrating from Text Completions to Messages.

        Args:
          max_tokens_to_sample: The maximum number of tokens to generate before stopping.

              Note that our models may stop _before_ reaching this maximum. This parameter
              only specifies the absolute maximum number of tokens to generate.

          model: The model that will complete your prompt.

See
              [models](https://docs.anthropic.com/en/docs/models-overview) for additional
              details and options.

          prompt: The prompt that you want Claude to complete.

              For proper response generation you will need to format your prompt using
              alternating `

Human:` and `

Assistant:` conversational turns. For example:

              ```
              "

Human: {userQuestion}

Assistant:"
              ```

              See [prompt validation](https://docs.anthropic.com/en/api/prompt-validation) and
              our guide to
              [prompt design](https://docs.anthropic.com/en/docs/intro-to-prompting) for more
              details.

          metadata: An object describing metadata about the request.

          stop_sequences: Sequences that will cause the model to stop generating.

              Our models stop on `"

Human:"`, and may include additional built-in stop
              sequences in the future. By providing the stop_sequences parameter, you may
              include additional strings that will cause the model to stop generating.

          stream: Whether to incrementally stream the response using server-sent events.

              See [streaming](https://docs.anthropic.com/en/api/streaming) for details.

          temperature: Amount of randomness injected into the response.

              Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
              for analytical / multiple choice, and closer to `1.0` for creative and
              generative tasks.

              Note that even with `temperature` of `0.0`, the results will not be fully
              deterministic.

          top_k: Only sample from the top K options for each subsequent token.

              Used to remove "long tail" low probability responses.
              [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).

              Recommended for advanced use cases only. You usually only need to use
              `temperature`.

          top_p: Use nucleus sampling.

              In nucleus sampling, we compute the cumulative distribution over all the options
              for each subsequent token in decreasing probability order and cut it off once it
              reaches a particular probability specified by `top_p`. You should either alter
              `temperature` or `top_p`, but not both.

              Recommended for advanced use cases only. You usually only need to use
              `temperature`.

          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
        N© ©r'   r:   r<   r=   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   s                 r(   ÚcreatezCompletions.create4   ó
   € ðL 	ˆr*   ©	r0   r1   r3   r4   r5   r6   r7   r8   r9   úLiteral[True]úStream[Completion]c               ó   — dS ©a[  [Legacy] Create a Text Completion.

        The Text Completions API is a legacy API.

        We recommend using the
        [Messages API](https://docs.anthropic.com/en/api/messages) going forward.

        Future models and features will not be compatible with Text Completions. See our
        [migration guide](https://docs.anthropic.com/en/api/migrating-from-text-completions-to-messages)
        for guidance in migrating from Text Completions to Messages.

        Args:
          max_tokens_to_sample: The maximum number of tokens to generate before stopping.

              Note that our models may stop _before_ reaching this maximum. This parameter
              only specifies the absolute maximum number of tokens to generate.

          model: The model that will complete your prompt.

See
              [models](https://docs.anthropic.com/en/docs/models-overview) for additional
              details and options.

          prompt: The prompt that you want Claude to complete.

              For proper response generation you will need to format your prompt using
              alternating `

Human:` and `

Assistant:` conversational turns. For example:

              ```
              "

Human: {userQuestion}

Assistant:"
              ```

              See [prompt validation](https://docs.anthropic.com/en/api/prompt-validation) and
              our guide to
              [prompt design](https://docs.anthropic.com/en/docs/intro-to-prompting) for more
              details.

          stream: Whether to incrementally stream the response using server-sent events.

              See [streaming](https://docs.anthropic.com/en/api/streaming) for details.

          metadata: An object describing metadata about the request.

          stop_sequences: Sequences that will cause the model to stop generating.

              Our models stop on `"

Human:"`, and may include additional built-in stop
              sequences in the future. By providing the stop_sequences parameter, you may
              include additional strings that will cause the model to stop generating.

          temperature: Amount of randomness injected into the response.

              Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
              for analytical / multiple choice, and closer to `1.0` for creative and
              generative tasks.

              Note that even with `temperature` of `0.0`, the results will not be fully
              deterministic.

          top_k: Only sample from the top K options for each subsequent token.

              Used to remove "long tail" low probability responses.
              [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).

              Recommended for advanced use cases only. You usually only need to use
              `temperature`.

          top_p: Use nucleus sampling.

              In nucleus sampling, we compute the cumulative distribution over all the options
              for each subsequent token in decreasing probability order and cut it off once it
              reaches a particular probability specified by `top_p`. You should either alter
              `temperature` or `top_p`, but not both.

              Recommended for advanced use cases only. You usually only need to use
              `temperature`.

          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
        NrJ   ©r'   r:   r<   r=   r2   r0   r1   r3   r4   r5   r6   r7   r8   r9   s                 r(   rL   zCompletions.createœ   rM   r*   ÚboolúCompletion | Stream[Completion]c               ó   — dS rR   rJ   rS   s                 r(   rL   zCompletions.create  rM   r*   ©r:   r<   r=   ©r:   r<   r=   r2   ú)Literal[False] | Literal[True] | NotGivenc               ó  — t          |¦  «        s| j        j        t          k    rd}|                      dt          |||||||||	dœ	t          j        ¦  «        t          |
|||¬¦  «        t          |pdt          t                   ¬¦  «        S ©NiX  z/v1/complete)	r:   r<   r=   r0   r1   r2   r3   r4   r5   )r6   r7   r8   r9   F)ÚbodyÚoptionsÚcast_tor2   Ú
stream_cls)r   Ú_clientr9   r   Ú_postr   r	   ÚCompletionCreateParamsr   r   r   rK   s                 r(   rL   zCompletions.createl  s³   € õ( ˜Ñ Ô ð 	 T¤\Ô%9½_Ò%LÐ%LØˆGØ�zŠzØÝ à,@Ø"Ø$Ø (Ø&4Ø$Ø#.Ø"Ø"ð
ð 
õ )Ô?ñô õ )Ø+¸ÐQ[Ðelðñ ô õ Ø�?˜UÝ�jÔ)ð+ ñ 
ô 
ð 	
r*   )r"   r#   )r"   r+   ©r:   r;   r<   r   r=   r>   r0   r?   r1   r@   r2   rA   r3   rB   r4   rC   r5   rB   r6   rD   r7   rE   r8   rF   r9   rG   r"   r   )r:   r;   r<   r   r=   r>   r2   rO   r0   r?   r1   r@   r3   rB   r4   rC   r5   rB   r6   rD   r7   rE   r8   rF   r9   rG   r"   rP   )r:   r;   r<   r   r=   r>   r2   rT   r0   r?   r1   r@   r3   rB   r4   rC   r5   rB   r6   rD   r7   rE   r8   rF   r9   rG   r"   rU   )r:   r;   r<   r   r=   r>   r0   r?   r1   r@   r2   rY   r3   rB   r4   rC   r5   rB   r6   rD   r7   rE   r8   rF   r9   rG   r"   rU   ©
Ú__name__Ú
__module__Ú__qualname__r   r)   r.   r   r
   rL   r   rJ   r*   r(   r   r       s­  € € € € € Øð0ð 0ð 0ñ „_ð0ð ð6ð 6ð 6ñ „_ð6ð ð .7Ø/8Ø,5Ø(1Ø )Ø"+ð )-Ø$(Ø"&Ø;Dð#eð eð eð eð eñ „XðeðN ð .7Ø/8Ø(1Ø )Ø"+ð )-Ø$(Ø"&Ø;Dð#eð eð eð eð eñ „XðeðN ð .7Ø/8Ø(1Ø )Ø"+ð )-Ø$(Ø"&Ø;Dð#eð eð eð eð eñ „XðeðN €]Ð>Ð>Ð>Ð@uÐ@uÐ@uÑvÔvð .7Ø/8Ø<EØ(1Ø )Ø"+ð )-Ø$(Ø"&Ø;Dð#+
ð +
ð +
ð +
ð +
ñ wÔvð+
ð +
ð +
r*   c                  ó  — e Zd Zed.d„¦   «         Zed/d„¦   «         Zeeeeeeedddedœ
d0d"„¦   «         Zeeeeeeddded#œ	d1d&„¦   «         Zeeeeeeddded#œ	d2d)„¦   «         Z e	g d*¢g d+¢¦  «        eeeeeedddedœ
d3d-„¦   «         ZdS )4r    r"   ÚAsyncCompletionsWithRawResponsec                ó    — t          | ¦  «        S r%   )ri   r&   s    r(   r)   z"AsyncCompletions.with_raw_responseœ  s   € õ /¨tÑ4Ô4Ð4r*   Ú%AsyncCompletionsWithStreamingResponsec                ó    — t          | ¦  «        S r-   )rk   r&   s    r(   r.   z(AsyncCompletions.with_streaming_response¦  s   € õ 5°TÑ:Ô:Ð:r*   Nr/   r:   r;   r<   r   r=   r>   r0   r?   r1   r@   r2   rA   r3   rB   r4   rC   r5   r6   rD   r7   rE   r8   rF   r9   rG   r   c             ƒ  ó
   K  — dS rI   rJ   rK   s                 r(   rL   zAsyncCompletions.create¯  ó   è è € ðL 	ˆr*   rN   rO   úAsyncStream[Completion]c             ƒ  ó
   K  — dS rR   rJ   rS   s                 r(   rL   zAsyncCompletions.create  rn   r*   rT   ú$Completion | AsyncStream[Completion]c             ƒ  ó
   K  — dS rR   rJ   rS   s                 r(   rL   zAsyncCompletions.create  rn   r*   rW   rX   rY   c             ƒ  ó4  K  — t          |¦  «        s| j        j        t          k    rd}|                      dt          |||||||||	dœ	t          j        ¦  «        ƒ d {V —†t          |
|||¬¦  «        t          |pdt          t                   ¬¦  «        ƒ d {V —†S r[   )r   r`   r9   r   ra   r   r	   rb   r   r   r   rK   s                 r(   rL   zAsyncCompletions.createç  só   è è € õ( ˜Ñ Ô ð 	 T¤\Ô%9½_Ò%LÐ%LØˆGØ—Z’ZØÝ,à,@Ø"Ø$Ø (Ø&4Ø$Ø#.Ø"Ø"ð
ð 
õ )Ô?ñô ð ð ð ð ð ð õ )Ø+¸ÐQ[Ðelðñ ô õ Ø�?˜UÝ"¥:Ô.ð+  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r*   )r"   ri   )r"   rk   rc   )r:   r;   r<   r   r=   r>   r2   rO   r0   r?   r1   r@   r3   rB   r4   rC   r5   rB   r6   rD   r7   rE   r8   rF   r9   rG   r"   ro   )r:   r;   r<   r   r=   r>   r2   rT   r0   r?   r1   r@   r3   rB   r4   rC   r5   rB   r6   rD   r7   rE   r8   rF   r9   rG   r"   rq   )r:   r;   r<   r   r=   r>   r0   r?   r1   r@   r2   rY   r3   rB   r4   rC   r5   rB   r6   rD   r7   rE   r8   rF   r9   rG   r"   rq   rd   rJ   r*   r(   r    r    ›  s­  € € € € € Øð5ð 5ð 5ñ „_ð5ð ð;ð ;ð ;ñ „_ð;ð ð .7Ø/8Ø,5Ø(1Ø )Ø"+ð )-Ø$(Ø"&Ø;Dð#eð eð eð eð eñ „XðeðN ð .7Ø/8Ø(1Ø )Ø"+ð )-Ø$(Ø"&Ø;Dð#eð eð eð eð eñ „XðeðN ð .7Ø/8Ø(1Ø )Ø"+ð )-Ø$(Ø"&Ø;Dð#eð eð eð eð eñ „XðeðN €]Ð>Ð>Ð>Ð@uÐ@uÐ@uÑvÔvð .7Ø/8Ø<EØ(1Ø )Ø"+ð )-Ø$(Ø"&Ø;Dð#+
ð +
ð +
ð +
ð +
ñ wÔvð+
ð +
ð +
r*   c                  ó   — e Zd Zdd„ZdS )r#   Úcompletionsr   r"   ÚNonec                óP   — || _         t          j        |j        ¦  «        | _        d S ©N)Ú_completionsr   Úto_raw_response_wrapperrL   ©r'   ru   s     r(   Ú__init__z#CompletionsWithRawResponse.__init__  s(   € Ø'ˆÔå&Ô>ØÔñ
ô 
ˆŒˆˆr*   N©ru   r   r"   rv   ©re   rf   rg   r|   rJ   r*   r(   r#   r#     ó(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r*   r#   c                  ó   — e Zd Zdd„ZdS )ri   ru   r    r"   rv   c                óP   — || _         t          j        |j        ¦  «        | _        d S rx   )ry   r   Úasync_to_raw_response_wrapperrL   r{   s     r(   r|   z(AsyncCompletionsWithRawResponse.__init__   s(   € Ø'ˆÔå&ÔDØÔñ
ô 
ˆŒˆˆr*   N©ru   r    r"   rv   r~   rJ   r*   r(   ri   ri     r   r*   ri   c                  ó   — e Zd Zdd„ZdS )r+   ru   r   r"   rv   c                óF   — || _         t          |j        ¦  «        | _        d S rx   )ry   r   rL   r{   s     r(   r|   z)CompletionsWithStreamingResponse.__init__)  s%   € Ø'ˆÔå2ØÔñ
ô 
ˆŒˆˆr*   Nr}   r~   rJ   r*   r(   r+   r+   (  r   r*   r+   c                  ó   — e Zd Zdd„ZdS )rk   ru   r    r"   rv   c                óF   — || _         t          |j        ¦  «        | _        d S rx   )ry   r   rL   r{   s     r(   r|   z.AsyncCompletionsWithStreamingResponse.__init__2  s%   € Ø'ˆÔå8ØÔñ
ô 
ˆŒˆˆr*   Nrƒ   r~   rJ   r*   r(   rk   rk   1  r   r*   rk   )3Ú
__future__r   Útypingr   Útyping_extensionsr   r   ÚhttpxÚ r   Útypesr	   Ú_typesr
   r   r   r   r   Ú_utilsr   r   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
_constantsr   Ú
_streamingr   r   Ú_base_clientr   Útypes.completionr   Útypes.model_paramr   Útypes.metadata_paramr   Ú__all__r   r    r#   ri   r+   rk   rJ   r*   r(   ú<module>rš      s¨  ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /à €€€à Ð Ð Ð Ð Ð Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >ðð ð ð ð ð ð ð ð ð ð ð ð &Ð %Ð %Ð %Ð %Ð %Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø XÐ XÐ XÐ XÐ XÐ XÐ XÐ XØ (Ð (Ð (Ð (Ð (Ð (Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø /Ð /Ð /Ð /Ð /Ð /Ø )Ð )Ð )Ð )Ð )Ð )Ø *Ð *Ð *Ð *Ð *Ð *Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0àÐ,Ð
-€ðx
ð x
ð x
ð x
ð x
�/ñ x
ô x
ð x
ðvx
ð x
ð x
ð x
ð x
Ð'ñ x
ô x
ð x
ðv
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
r*   