> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytez.com/llms.txt
> Use this file to discover all available pages before exploring further.

# question-answering

> Answer questions based on a given context for applications like customer support, information retrieval, and educational tools

<AccordionGroup>
  <Accordion defaultOpen="true" title="Basic usage">
    Send a question with context to a model to generate an answer

    <CodeGroup>
      ```javascript javascript theme={null}
      import Bytez from 'bytez.js';

      // insert your key
      const sdk = new Bytez('BYTEZ_KEY');

      // choose your model
      const model = sdk.model('deepset/roberta-base-squad2');

      // provide the model with input
      const input = {
        "question": "Where does Holly live?",
        "context": "My name is Holly and I live in NYC"
      };

      // send to the model
      const { error, output } = await model.run(input);

      // observe the output
      console.log({ error, output });

      ```

      ```python python theme={null}
      from bytez import Bytez

      # insert your key
      sdk = Bytez("BYTEZ_KEY")

      # choose your model
      model = sdk.model("deepset/roberta-base-squad2")

      # provide the model with input
      input = {
        "question": "Where does Holly live?",
        "context": "My name is Holly and I live in NYC"
      }

      # send to the model
      result = model.run(input)

      # observe the output
      print({"error": result.error, "output": result.output})

      ```

      ```bash http theme={null}
      curl -X POST 'https://api.bytez.com/models/v2/deepset/roberta-base-squad2' \
      -H 'Authorization: BYTEZ_KEY' \
      -H 'Content-Type: application/json' \
      --data '{
        "question": "Where does Holly live?",
        "context": "My name is Holly and I live in NYC"
      }'
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>
