(self, content: str)
| 667 | return texts["documents"][0] |
| 668 | |
| 669 | def summaryEmbedding(self, content: str): |
| 670 | limit_access = st.session_state["openai_limit_access"] |
| 671 | if not limit_access: |
| 672 | res = self.chatModel.invoke(self.summaryPromptEnglish.format(content)) |
| 673 | embedding = self.embedding_model([res.content]) |
| 674 | else: |
| 675 | self.openaiAccessRate += 2 |
| 676 | if self.openaiAccessRate >= 3: |
| 677 | time.sleep(20) |
| 678 | res = self.chatModel.invoke(self.summaryPromptEnglish.format(content)) |
| 679 | embedding = self.embedding_model([res.content]) |
| 680 | self.openaiAccessRate %= 3 |
| 681 | else: |
| 682 | res = self.chatModel.invoke(self.summaryPromptEnglish.format(content)) |
| 683 | embedding = self.embedding_model([res.content]) |
| 684 | return embedding[0] |
| 685 | |
| 686 | def generated_id(self) -> str: |
| 687 | characters = string.ascii_letters + string.digits |
no outgoing calls
no test coverage detected