-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18951 from newrelic/translations-13bb55e7
Updated translations - (machine translation)
- Loading branch information
Showing
124 changed files
with
2,399 additions
and
2,909 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
...ents/python-agent/python-agent-api/withllmcustomattributes-python-agent-api.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
title: WithLlmCustomAttributes (API del agente de Python) | ||
type: apiDoc | ||
shortDescription: Agregar atributo personalizado al evento LLM | ||
tags: | ||
- Agents | ||
- Python agent | ||
- Python agent API | ||
metaDescription: 'Python API: This API adds custom attributes to a Large Language Model (LLM) events generated in AI applications.' | ||
freshnessValidatedDate: never | ||
translationType: machine | ||
--- | ||
|
||
## Sintaxis [#syntax] | ||
|
||
```py | ||
with newrelic.agent.WithLlmCustomAttributes(custom_attribute_map): | ||
``` | ||
|
||
API de administrador de contexto que agrega un atributo especificado por el usuario al evento de modelo de lenguaje extenso (LLM) generado por llamadas de LLM en el código de la aplicación. | ||
|
||
## Requisitos [#requirements] | ||
|
||
Versión 10.1.0 del agente Python o superior. | ||
|
||
## Descripción [#description] | ||
|
||
Esta API de administrador de contexto agrega atributos personalizados especificados por el usuario a cada evento LLM generado dentro de su contexto en función de las llamadas realizadas a los LLM. El agente agregará automáticamente un prefijo `llm.` a cada nombre de clave de atributo personalizado especificado en el argumento del diccionario pasado. Esta API debe llamar dentro del contexto de una transacción activa. | ||
|
||
Estos atributos personalizados se pueden ver en LLM evento y consultar en la New Relic UI. Para obtener más información sobre el monitoreo de IA, consulte nuestra [documentación de IA](https://docs.newrelic.com/docs/ai-monitoring/intro-to-ai-monitoring/). | ||
|
||
## Parámetros [#parameters] | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th width="25%"> | ||
Parámetro | ||
</th> | ||
|
||
<th> | ||
Descripción | ||
</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<tr> | ||
<td> | ||
`custom_attribute_map` | ||
|
||
*diccionario* | ||
</td> | ||
|
||
<td> | ||
Requerido. Un diccionario no vacío donde cada par de valores principales indica el nombre del atributo personalizado y su respectivo valor. | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
## Valores de retorno [#return-values] | ||
|
||
Ninguno. | ||
|
||
## Ejemplos [#examples] | ||
|
||
### Agregue un atributo personalizado a una llamada de finalización de chat OpenAI | ||
|
||
```py | ||
import newrelic.agent | ||
|
||
from openai import OpenAI | ||
|
||
client = OpenAI() | ||
|
||
with newrelic.agent.WithLlmCustomAttributes({"custom": "attr", "custom1": "attr1"}): | ||
response = client.chat.completions.create( | ||
messages=[{ | ||
"role": "user", | ||
"content": "Say this is a test", | ||
}], | ||
model="gpt-4o-mini", | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.