Nancy1906 commited on
Commit
4a916e4
·
verified ·
1 Parent(s): ab5d851
Files changed (1) hide show
  1. my_tools.py +8 -7
my_tools.py CHANGED
@@ -1,6 +1,7 @@
1
  import os, math, wikipedia, asyncio
2
  import google.generativeai as genai
3
  from typing import List, Generator
 
4
 
5
  from llama_index.core.llms import (
6
  LLM,
@@ -25,13 +26,13 @@ class GeminiLLM(LLM):
25
 
26
  # ---------- metadata ----------
27
  @property
28
- def metadata(self):
29
- return {
30
- "context_window": 32768,
31
- "num_output": 2048,
32
- "is_chat_model": True,
33
- "model_name": self._model_name,
34
- }
35
 
36
  # ---------- chat ----------
37
  def chat(self, messages: List[ChatMessage], **kwargs) -> ChatResponse:
 
1
  import os, math, wikipedia, asyncio
2
  import google.generativeai as genai
3
  from typing import List, Generator
4
+ from llama_index.core.llms import LLMMetadata
5
 
6
  from llama_index.core.llms import (
7
  LLM,
 
26
 
27
  # ---------- metadata ----------
28
  @property
29
+ def metadata(self) -> LLMMetadata:
30
+ return LLMMetadata(
31
+ context_window=32768,
32
+ num_output=2048,
33
+ is_chat_model=True,
34
+ model_name=self._model_name
35
+ )
36
 
37
  # ---------- chat ----------
38
  def chat(self, messages: List[ChatMessage], **kwargs) -> ChatResponse: