Segui le istruzioni di sistema

Le istruzioni di sistema sono come un preambolo che aggiungi prima che l'LLM venga esposto a ulteriori istruzioni dell'utente. Consente agli utenti di orientare il comportamento del modello in base alle esigenze e ai casi d'uso specifici. Quando imposti un'istruzione di sistema, fornisci al modello un contesto aggiuntivo per comprendere l'attività, fornisci risposte più personalizzate e segui linee guida specifiche per l'intera interazione dell'utente con il modello. Per gli sviluppatori, il comportamento a livello di prodotto può essere specificato nelle istruzioni di sistema, separatamente dai prompt forniti dagli utenti finali. Ad esempio, puoi includere il ruolo o l'utente tipo, le informazioni contestuali e le istruzioni di formattazione:

You are a friendly and helpful assistant.
Ensure your answers are complete, unless the user requests a more concise approach.
When generating code, offer explanations for code segments as necessary and maintain good coding practices.
When presented with inquiries seeking information, provide answers that reflect a deep understanding of the field, guaranteeing their correctness.
For any non-english queries, respond in the same language as the prompt unless otherwise specified by the user.
For prompts involving reasoning, provide a clear explanation of each step in the reasoning process before presenting the final answer.

I seguenti modelli Gemini supportano le istruzioni di sistema:

  • gemini-1.5-flash-001
  • gemini-1.5-pro-001
  • gemini-1.0-pro-002

Se utilizzi un modello diverso, consulta invece Assegnare un ruolo.

Puoi utilizzare le istruzioni di sistema in molti modi, tra cui:

  • Definire un utente tipo o un ruolo (ad esempio per un chatbot)
  • Definizione del formato di output (markdown, YAML e così via)
  • Definizione dello stile e del tono dell'output (ad esempio, livello di dettaglio, formalità e livello di lettura target)
  • Definizione degli obiettivi o delle regole per l'attività (ad esempio, la restituzione di uno snippet di codice senza ulteriori spiegazioni)
  • Fornire un contesto aggiuntivo per il prompt (ad esempio, un limite di conoscenze)

Quando è impostata un'istruzione di sistema, questa viene applicata all'intera richiesta. Funziona per più turni di utenti e modelli se incluso nel prompt. Sebbene le istruzioni di sistema siano separate dai contenuti del prompt, fanno comunque parte dei prompt generali e, di conseguenza, sono soggette ai criteri standard sull'utilizzo dei dati.

Esempi di codice

Gli esempi di codice nelle seguenti schede mostrano come utilizzare le istruzioni di sistema nella tua applicazione di AI generativa.

Python

Per scoprire come installare o aggiornare l'SDK Vertex AI per Python, vedi Installare l'SDK Vertex AI per Python. Per ulteriori informazioni, consulta la documentazione di riferimento dell'API Vertex AI SDK per Python.

Risposte dinamiche e non dinamiche

Puoi scegliere se il modello genera risposte in streaming o non in streaming. Per le risposte dinamiche, ricevi ogni risposta non appena viene generato il relativo token di output. Per le risposte non in streaming, riceverai tutte le risposte dopo che sono stati generati tutti i token di output.

Per una risposta in modalità flusso, utilizza il parametro stream in generate_content.

  response = model.generate_content(contents=[...], stream = True)
  

Per una risposta non in streaming, rimuovi il parametro o impostalo su False.

Codice di esempio

import vertexai

from vertexai.generative_models import GenerativeModel

# TODO(developer): Update and un-comment below lines
# project_id = "PROJECT_ID"

vertexai.init(project=project_id, location="us-central1")

model = GenerativeModel(
    model_name="gemini-1.5-flash-001",
    system_instruction=[
        "You are a helpful language translator.",
        "Your mission is to translate text in English to French.",
    ],
)

prompt = """
User input: I like bagels.
Answer:
"""

contents = [prompt]

response = model.generate_content(contents)
print(response.text)

Node.js

Prima di provare questo esempio, segui le istruzioni per la configurazione di Node.js nella guida rapida dell'IA generativa utilizzando l'SDK Node.js. Per maggiori informazioni, consulta la documentazione di riferimento dell'SDK Node.js per Gemini.

Per eseguire l'autenticazione su Vertex AI, configura Credenziali predefinite dell'applicazione. Per maggiori informazioni, vedi Configurare l'autenticazione per un ambiente di sviluppo locale.

Risposte dinamiche e non dinamiche

Puoi scegliere se il modello genera risposte in streaming o non in streaming. Per le risposte dinamiche, ricevi ogni risposta non appena viene generato il relativo token di output. Per le risposte non in streaming, riceverai tutte le risposte dopo che sono stati generati tutti i token di output.

Per una risposta in modalità flusso, utilizza il metodo generateContentStream.

  const streamingResp = await generativeModel.generateContentStream(request);
  

Per una risposta non in modalità flusso, utilizza il metodo generateContent.

  const streamingResp = await generativeModel.generateContent(request);
  

Codice di esempio

const {VertexAI} = require('@google-cloud/vertexai');

/**
 * TODO(developer): Update these variables before running the sample.
 */
async function set_system_instruction(projectId = 'PROJECT_ID') {
  const vertexAI = new VertexAI({project: projectId, location: 'us-central1'});

  const generativeModel = vertexAI.getGenerativeModel({
    model: 'gemini-1.5-flash-001',
    systemInstruction: {
      parts: [
        {text: 'You are a helpful language translator.'},
        {text: 'Your mission is to translate text in English to French.'},
      ],
    },
  });

  const textPart = {
    text: `
    User input: I like bagels.
    Answer:`,
  };

  const request = {
    contents: [{role: 'user', parts: [textPart]}],
  };

  const resp = await generativeModel.generateContent(request);
  const contentResponse = await resp.response;
  console.log(JSON.stringify(contentResponse));
}

Java

Prima di provare questo esempio, segui le istruzioni di configurazione di Java nella guida rapida di Vertex AI. Per ulteriori informazioni, consulta la documentazione di riferimento dell'SDK Vertex AI Java per Gemini.

Per eseguire l'autenticazione su Vertex AI, configura Credenziali predefinite dell'applicazione. Per maggiori informazioni, vedi Configurare l'autenticazione per un ambiente di sviluppo locale.

Risposte dinamiche e non dinamiche

Puoi scegliere se il modello genera risposte in streaming o non in streaming. Per le risposte dinamiche, ricevi ogni risposta non appena viene generato il relativo token di output. Per le risposte non in streaming, riceverai tutte le risposte dopo che sono stati generati tutti i token di output.

Per una risposta in modalità flusso, utilizza il metodo generateContentStream.

  public ResponseStream generateContentStream(Content content)
  

Per una risposta non in modalità flusso, utilizza il metodo generateContent.

  public GenerateContentResponse generateContent(Content content)
  

Codice di esempio

import com.google.cloud.vertexai.VertexAI;
import com.google.cloud.vertexai.api.GenerateContentResponse;
import com.google.cloud.vertexai.generativeai.ContentMaker;
import com.google.cloud.vertexai.generativeai.GenerativeModel;
import com.google.cloud.vertexai.generativeai.ResponseHandler;

public class WithSystemInstruction {

  public static void main(String[] args) throws Exception {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "your-google-cloud-project-id";
    String location = "us-central1";
    String modelName = "gemini-1.5-flash-001";

    String output = translateToFrench(projectId, location, modelName);
    System.out.println(output);
  }

  // Ask the model to translate from English to French with a system instruction.
  public static String translateToFrench(String projectId, String location, String modelName)
      throws Exception {
    // Initialize client that will be used to send requests.
    // This client only needs to be created once, and can be reused for multiple requests.
    try (VertexAI vertexAI = new VertexAI(projectId, location)) {
      String output;

      GenerativeModel model = new GenerativeModel(modelName, vertexAI)
          .withSystemInstruction(ContentMaker.fromString("You are a helpful assistant.\n"
            + "Your mission is to translate text in English to French."));

      GenerateContentResponse response = model.generateContent("User input: I like bagels.\n"
          + "Answer:");
      output = ResponseHandler.getText(response);
      return output;
    }
  }
}

Go

Prima di provare questo esempio, segui le istruzioni di configurazione di Go nella guida rapida di Vertex AI. Per ulteriori informazioni, consulta la documentazione di riferimento dell'SDK Vertex AI Go per Gemini.

Per eseguire l'autenticazione su Vertex AI, configura Credenziali predefinite dell'applicazione. Per ulteriori informazioni, vedi Configurare l'autenticazione per un ambiente di sviluppo locale.

Risposte dinamiche e non dinamiche

Puoi scegliere se il modello genera risposte in streaming o non in streaming. Per le risposte dinamiche, ricevi ogni risposta non appena viene generato il relativo token di output. Per le risposte non in streaming, riceverai tutte le risposte dopo che sono stati generati tutti i token di output.

Per una risposta in modalità flusso, utilizza il metodo GenerateContentStream.

  iter := model.GenerateContentStream(ctx, genai.Text("Tell me a story about a lumberjack and his giant ox. Keep it very short."))
  

Per una risposta non di streaming, utilizza il metodo GenerateContent.

  resp, err := model.GenerateContent(ctx, genai.Text("What is the average size of a swallow?"))
  

Codice di esempio

import (
	"context"
	"errors"
	"fmt"
	"io"

	"cloud.google.com/go/vertexai/genai"
)

// systemInstruction shows how to provide a system instruction to the generative model.
func systemInstruction(w io.Writer, instruction, prompt, projectID, location, modelName string) error {
	// instruction := `
	// 		You are a helpful language translator.
	// 		Your mission is to translate text in English to French.`
	// prompt := `
	//		User input: I like bagels.
	//		Answer:`
	// location := "us-central1"
	// modelName := "gemini-1.5-flash-001"

	ctx := context.Background()

	client, err := genai.NewClient(ctx, projectID, location)
	if err != nil {
		return fmt.Errorf("unable to create client: %w", err)
	}
	defer client.Close()

	// The System Instruction is set at model creation
	model := client.GenerativeModel(modelName)
	model.SystemInstruction = &genai.Content{
		Parts: []genai.Part{genai.Text(instruction)},
	}

	res, err := model.GenerateContent(ctx, genai.Text(prompt))
	if err != nil {
		return fmt.Errorf("unable to generate contents: %w", err)
	}
	if len(res.Candidates) == 0 ||
		len(res.Candidates[0].Content.Parts) == 0 {
		return errors.New("empty response from model")
	}
	fmt.Fprintf(w, "generated response: %s\n", res.Candidates[0].Content.Parts[0])

	return nil
}

C#

Prima di provare questo esempio, segui le istruzioni per la configurazione di C# nella guida rapida di Vertex AI. Per ulteriori informazioni, consulta la documentazione di riferimento C# di Vertex AI.

Per eseguire l'autenticazione su Vertex AI, configura Credenziali predefinite dell'applicazione. Per maggiori informazioni, vedi Configurare l'autenticazione per un ambiente di sviluppo locale.

Risposte dinamiche e non dinamiche

Puoi scegliere se il modello genera risposte in streaming o non in streaming. Per le risposte dinamiche, ricevi ogni risposta non appena viene generato il relativo token di output. Per le risposte non in streaming, riceverai tutte le risposte dopo che sono stati generati tutti i token di output.

Per una risposta in modalità flusso, utilizza il metodo StreamGenerateContent.

  public virtual PredictionServiceClient.StreamGenerateContentStream StreamGenerateContent(GenerateContentRequest request)
  

Per una risposta non in modalità flusso, utilizza il metodo GenerateContentAsync.

  public virtual Task<GenerateContentResponse> GenerateContentAsync(GenerateContentRequest request)
  

Per ulteriori informazioni su come il server può trasmettere le risposte in streaming, consulta RPC per lo streaming.

Codice di esempio


using Google.Cloud.AIPlatform.V1;
using System;
using System.Threading.Tasks;

public class SystemInstruction
{
    public async Task<string> SetSystemInstruction(
        string projectId = "your-project-id",
        string location = "us-central1",
        string publisher = "google",
        string model = "gemini-1.5-flash-001")
    {

        var predictionServiceClient = new PredictionServiceClientBuilder
        {
            Endpoint = $"{location}-aiplatform.googleapis.com"
        }.Build();

        string prompt = @"User input: I like bagels.
Answer:";

        var generateContentRequest = new GenerateContentRequest
        {
            Model = $"projects/{projectId}/locations/{location}/publishers/{publisher}/models/{model}",
            Contents =
            {
                new Content
                {
                    Role = "USER",
                    Parts =
                    {
                        new Part { Text = prompt },
                    }
                }
            },
            SystemInstruction = new()
            {
                Parts =
                {
                    new Part { Text = "You are a helpful assistant." },
                    new Part { Text = "Your mission is to translate text in English to French." },
                }
            }
        };

        GenerateContentResponse response = await predictionServiceClient.GenerateContentAsync(generateContentRequest);

        string responseText = response.Candidates[0].Content.Parts[0].Text;
        Console.WriteLine(responseText);

        return responseText;
    }
}

REST

Dopo aver configurato l'ambiente, puoi utilizzare REST per testare un prompt di testo. Il seguente esempio invia una richiesta all'endpoint del modello di publisher.

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • GENERATE_RESPONSE_METHOD: il tipo di risposta che deve essere generato dal modello. Scegli un metodo che generi il modo in cui vuoi che venga restituita la risposta del modello:
    • streamGenerateContent: la risposta viene riprodotta in streaming durante la generazione per ridurre la percezione della latenza per un pubblico umano.
    • generateContent: la risposta viene restituita dopo che è stata completamente generata.
  • LOCATION: la regione in cui elaborare la richiesta. Le opzioni disponibili sono le seguenti:

    Fai clic per espandere un elenco parziale delle regioni disponibili

    • us-central1
    • us-west4
    • northamerica-northeast1
    • us-east4
    • us-west1
    • asia-northeast3
    • asia-southeast1
    • asia-northeast1
  • PROJECT_ID: il tuo ID progetto.
  • MODEL_ID: l'ID del modello multimodale che vuoi utilizzare. Ecco alcune opzioni:
    • gemini-1.0-pro-002
    • gemini-1.0-pro-vision-001
    • gemini-1.5-pro-001
    • gemini-1.5-flash
  • ROLE: il ruolo in una conversazione associata ai contenuti. È necessario specificare un ruolo anche nei casi d'uso a turno singolo. I valori accettati sono:
    • USER: specifica i contenuti inviati da te.
    • MODEL: specifica la risposta del modello.
  • TEXT
    Le istruzioni testuali da includere nel prompt. Ad esempio, User input: I like bagels.
  • SAFETY_CATEGORY: la categoria di sicurezza per cui configurare una soglia. I valori accettati sono:

    Fai clic per espandere le categorie di sicurezza

    • HARM_CATEGORY_SEXUALLY_EXPLICIT
    • HARM_CATEGORY_HATE_SPEECH
    • HARM_CATEGORY_HARASSMENT
    • HARM_CATEGORY_DANGEROUS_CONTENT
  • THRESHOLD: la soglia per il blocco delle risposte che potrebbero appartenere alla categoria di sicurezza specificata in base alla probabilità. I valori accettati sono:

    Fai clic per espandere le soglie di blocco

    • BLOCK_NONE
    • BLOCK_ONLY_HIGH
    • BLOCK_MEDIUM_AND_ABOVE (valore predefinito)
    • BLOCK_LOW_AND_ABOVE
    BLOCK_LOW_AND_ABOVE blocca di più, mentre BLOCK_ONLY_HIGH blocca meno.
  • SYSTEM_INSTRUCTION
    (Facoltativo) Non disponibile per tutti i modelli. Istruzioni per il modello per guidarlo verso un rendimento migliore. JSON non supporta le interruzioni di riga. Sostituisci tutte le interruzioni di riga in questo campo con \n. Ad esempio, You are a helpful language translator.\nYour mission is to translate text in English to French.
  • TEMPERATURE: La temperatura viene utilizzata per il campionamento durante la generazione della risposta, che si verifica quando vengono applicati topP e topK. La temperatura controlla il grado di casualità nella selezione dei token. Le temperature più basse sono ideali per prompt che richiedono una risposta meno aperta o creativa, mentre le temperature più alte possono portare a risultati più diversificati o creativi. Una temperatura pari a 0 significa che vengono sempre selezionati i token con la probabilità più alta. In questo caso, le risposte a una determinata richiesta sono per lo più deterministiche, ma è comunque possibile una piccola variazione.

    Se il modello restituisce una risposta troppo generica, troppo breve o fornisce una risposta di riserva, prova ad aumentare la temperatura.

  • TOP_P: Top-P cambia il modo in cui il modello seleziona i token per l'output. I token vengono selezionati dal più probabile (vedi top-K) al meno probabile finché la somma delle probabilità non corrisponde al valore di top-P. Ad esempio, se i token A, B e C hanno una probabilità di 0,3, 0,2 e 0,1 e il valore di top-P è 0.5, il modello selezionerà A o B come token successivo utilizzando la temperatura ed esclude C come candidato.

    Specifica un valore più basso per risposte meno casuali e un valore più alto per risposte più casuali.

  • TOP_K: Top-K cambia il modo in cui il modello seleziona i token per l'output. Un top-K di 1 indica che il token successivo selezionato è il più probabile tra tutti i token nel vocabolario del modello (chiamato anche decodifica greedy). Un top-K pari a 3 indica che il token successivo viene selezionato tra i tre token più probabili utilizzando la temperatura.

    Per ogni passaggio di selezione dei token, vengono campionati i token top-K con le probabilità più alte. Quindi i token vengono ulteriormente filtrati in base a top-P e il token finale viene selezionato utilizzando il campionamento con temperatura.

    Specifica un valore più basso per risposte meno casuali e un valore più alto per risposte più casuali.

  • MAX_OUTPUT_TOKENS: numero massimo di token che possono essere generati nella risposta. Un token equivale a circa quattro caratteri. 100 token corrispondono a circa 60-80 parole.

    Specifica un valore più basso per risposte più brevi e un valore più alto per risposte potenzialmente più lunghe.

  • STOP_SEQUENCES: specifica un elenco di stringhe che indica al modello di interrompere la generazione di testo se una delle stringhe viene rilevata nella risposta. Se una stringa appare più volte nella risposta, la risposta viene troncata nel punto in cui viene rilevata per la prima volta. Le stringhe sono sensibili alle maiuscole.

    Ad esempio, se la seguente è la risposta restituita quando stopSequences non è specificato:

    public static string reverse(string myString)

    Quindi la risposta restituita con stopSequences impostato su ["Str", "reverse"] è:

    public static string

    Specifica un array vuoto ([]) per disabilitare le sequenze di interruzioni.

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl

Salva il corpo della richiesta in un file denominato request.json. Esegui questo comando nel terminale per creare o sovrascrivere questo file nella directory attuale:

cat > request.json << 'EOF'
{
  "contents": {
    "role": "ROLE",
    "parts": { "text": "TEXT" }
  },
  "system_instruction":
  {
    "parts": [
      {
        "text": "SYSTEM_INSTRUCTION"
      }
    ]
  },
  "safety_settings": {
    "category": "SAFETY_CATEGORY",
    "threshold": "THRESHOLD"
  },
  "generation_config": {
    "temperature": TEMPERATURE,
    "topP": TOP_P,
    "topK": TOP_K,
    "candidateCount": 1,
    "maxOutputTokens": MAX_OUTPUT_TOKENS,
    "stopSequences": STOP_SEQUENCES
  }
}
EOF

Quindi, esegui questo comando per inviare la richiesta REST:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/MODEL_ID:GENERATE_RESPONSE_METHOD"

PowerShell

Salva il corpo della richiesta in un file denominato request.json. Esegui questo comando nel terminale per creare o sovrascrivere questo file nella directory attuale:

@'
{
  "contents": {
    "role": "ROLE",
    "parts": { "text": "TEXT" }
  },
  "system_instruction":
  {
    "parts": [
      {
        "text": "SYSTEM_INSTRUCTION"
      }
    ]
  },
  "safety_settings": {
    "category": "SAFETY_CATEGORY",
    "threshold": "THRESHOLD"
  },
  "generation_config": {
    "temperature": TEMPERATURE,
    "topP": TOP_P,
    "topK": TOP_K,
    "candidateCount": 1,
    "maxOutputTokens": MAX_OUTPUT_TOKENS,
    "stopSequences": STOP_SEQUENCES
  }
}
'@  | Out-File -FilePath request.json -Encoding utf8

Quindi, esegui questo comando per inviare la richiesta REST:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/MODEL_ID:GENERATE_RESPONSE_METHOD" | Select-Object -Expand Content

Dovresti ricevere una risposta JSON simile alla seguente.

Nota quanto segue nell'URL di questo esempio:
  • Utilizza il metodo generateContent per richiedere che la risposta venga restituita dopo la completa generazione. Per ridurre la percezione della latenza per un pubblico umano, trasmetti il flusso della risposta mentre viene generata utilizzando il metodo streamGenerateContent.
  • L'ID modello multimodale si trova alla fine dell'URL, prima del metodo (ad esempio, gemini-1.5-flash o gemini-1.0-pro-vision). Questo esempio potrebbe supportare anche altri modelli.

Esempi di prompt

Ecco un esempio base di impostazione dell'istruzione di sistema utilizzando l'SDK Python per l'API Gemini:

model=genai.GenerativeModel(
    model_name="gemini-1.5-pro-001",
    system_instruction="You are a cat. Your name is Neko.")

Di seguito sono riportati alcuni esempi di prompt di sistema che definiscono il comportamento previsto del modello.

Generazione del codice

Generazione del codice
    You are a coding expert that specializes in rendering code for front-end interfaces. When I describe a component of a website I want to build, please return the HTML and CSS needed to do so. Do not give an explanation for this code. Also offer some UI design suggestions.
    
    Create a box in the middle of the page that contains a rotating selection of images each with a caption. The image in the center of the page should have shadowing behind it to make it stand out. It should also link to another page of the site. Leave the URL blank so that I can fill it in.
    

Generazione di dati formattati

Generazione di dati formattati
    You are an assistant for home cooks. You receive a list of ingredients and respond with a list of recipes that use those ingredients. Recipes which need no extra ingredients should always be listed before those that do.

    Your response must be a JSON object containing 3 recipes. A recipe object has the following schema:

    * name: The name of the recipe
    * usedIngredients: Ingredients in the recipe that were provided in the list
    * otherIngredients: Ingredients in the recipe that were not provided in the
      list (omitted if there are no other ingredients)
    * description: A brief description of the recipe, written positively as if
      to sell it
    
    * 1 lb bag frozen broccoli
    * 1 pint heavy cream
    * 1 lb pack cheese ends and pieces
    

Chatbot musicale

Chatbot musicale
    You will respond as a music historian, demonstrating comprehensive knowledge across diverse musical genres and providing relevant examples. Your tone will be upbeat and enthusiastic, spreading the joy of music. If a question is not related to music, the response should be, "That is beyond my knowledge."
    
    If a person was born in the sixties, what was the most popular music genre being played when they were born? List five songs by bullet point.
    

Analisi finanziaria

Analisi finanziaria
    As a financial analysis expert, your role is to interpret complex financial data, offer personalized advice, and evaluate investments using statistical methods to gain insights across different financial areas.

    Accuracy is the top priority. All information, especially numbers and calculations, must be correct and reliable. Always double-check for errors before giving a response. The way you respond should change based on what the user needs. For tasks with calculations or data analysis, focus on being precise and following instructions rather than giving long explanations. If you're unsure, ask the user for more information to ensure your response meets their needs.

    For tasks that are not about numbers:

    * Use clear and simple language to avoid confusion and don't use jargon.
    * Make sure you address all parts of the user's request and provide complete information.
    * Think about the user's background knowledge and provide additional context or explanation when needed.

    Formatting and Language:

    * Follow any specific instructions the user gives about formatting or language.
    * Use proper formatting like JSON or tables to make complex data or results easier to understand.
    
    Please summarize the key insights of given numerical tables.

    CONSOLIDATED STATEMENTS OF INCOME (In millions, except per share amounts)

    |Year Ended December 31                | 2020        | 2021        | 2022        |

    |---                                                        | ---                | ---                | ---                |

    |Revenues                                        | $ 182,527| $ 257,637| $ 282,836|

    |Costs and expenses:|

    |Cost of revenues                                | 84,732        | 110,939        | 126,203|

    |Research and development        | 27,573        | 31,562        | 39,500|

    |Sales and marketing                        | 17,946        | 22,912        | 26,567|

    |General and administrative        | 11,052        | 13,510        | 15,724|

    |Total costs and expenses                | 141,303| 178,923| 207,994|

    |Income from operations                | 41,224        | 78,714        | 74,842|

    |Other income (expense), net        | 6,858        | 12,020        | (3,514)|

    |Income before income taxes        | 48,082        | 90,734        | 71,328|

    |Provision for income taxes        | 7,813        | 14,701        | 11,356|

    |Net income                                        | $40,269| $76,033        | $59,972|

    |Basic net income per share of Class A, Class B, and Class C stock        | $2.96| $5.69| $4.59|

    |Diluted net income per share of Class A, Class B, and Class C stock| $2.93| $5.61| $4.56|

    Please list important, but no more than five, highlights from 2020 to 2022 in the given table.

    Please write in a professional and business-neutral tone.

    The summary should only be based on the information presented in the table.
    

Analisi del sentiment del mercato

Analisi del sentiment del mercato
    You are a stock market analyst who analyzes market sentiment given a news snippet. Based on the news snippet, you extract statements that impact investor sentiment.

    Respond in JSON format and for each statement:

    * Give a score 1 - 10 to suggest if the sentiment is negative or positive (1 is most negative 10 is most positive, 5 will be neutral).
    * Reiterate the statement.
    * Give a one sentence explanation.
    
    Mobileye reported a build-up of excess inventory by top-tier customers following supply-chain constraints in
    recent years. Revenue for the first quarter is expected to be down about 50% from $458 million generated a
    year earlier, before normalizing over the remainder of 2024, Mobileye said. Mobileye forecast revenue for
    full-year 2024 at between $1.83 billion and $1.96 billion, down from the about $2.08 billion it now expects for 2023.
    

Passaggi successivi