hevold commited on
Commit
093463f
·
verified ·
1 Parent(s): e9f685e

Upload generator.py

Browse files
Files changed (1) hide show
  1. src/rag/generator.py +8 -8
src/rag/generator.py CHANGED
@@ -1,29 +1,29 @@
1
  """
2
- Generator module for Norwegian RAG chatbot.
3
- Generates responses using retrieved context and LLM.
4
  """
5
 
6
  from typing import List, Dict, Any, Optional
7
 
8
- from ..api.huggingface_api import HuggingFaceAPI, create_rag_prompt
9
 
10
  class Generator:
11
  """
12
- Generates responses using retrieved context and LLM.
13
- Uses Hugging Face Inference API for text generation.
14
  """
15
 
16
  def __init__(
17
  self,
18
- api_client: Optional[HuggingFaceAPI] = None,
19
  ):
20
  """
21
  Initialize the generator.
22
 
23
  Args:
24
- api_client: HuggingFaceAPI client for text generation
25
  """
26
- self.api_client = api_client or HuggingFaceAPI()
27
 
28
  def generate(
29
  self,
 
1
  """
2
+ Generator module for Norwegian RAG chatbot with GPT-4o integration.
3
+ Generates responses using retrieved context and GPT-4o.
4
  """
5
 
6
  from typing import List, Dict, Any, Optional
7
 
8
+ from ..api.openai_api import OpenAIAPI, create_rag_prompt
9
 
10
  class Generator:
11
  """
12
+ Generates responses using retrieved context and GPT-4o.
13
+ Uses OpenAI API for text generation.
14
  """
15
 
16
  def __init__(
17
  self,
18
+ api_client: Optional[OpenAIAPI] = None,
19
  ):
20
  """
21
  Initialize the generator.
22
 
23
  Args:
24
+ api_client: OpenAIAPI client for text generation
25
  """
26
+ self.api_client = api_client or OpenAIAPI()
27
 
28
  def generate(
29
  self,