This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A patient with fever and chill and severe coughing with cold. He has fever since 7 days and swelling at right foot. Already | |
he is diagnosed with diabetes malattie. He is on tablet meclizidam 500 and insulin 12 unit since last 1 year. Now his reports | |
are showing that he is malaria positive with right foot cellulitis. He is on tablet zoseph cv, tablet lumerex 4 bd for 3 days, | |
tablet paracetamol 500 for 3 days, capsule pandi twice bd, daily dressing with glycerin and kmn 4, daily hgt checking twice | |
a day and giving dose of insulin as per scale. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict, List, Optional, Tuple, Union | |
import openai | |
import json | |
import tiktoken | |
from promptify.parser.parser import Parser | |
from promptify.models.nlp.text2text.base_model import Model | |
class OpenAI(Model): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict, List, Optional, Tuple, Union | |
import openai | |
import json | |
import tiktoken | |
from promptify.parser.parser import Parser | |
from promptify.models.nlp.text2text.base_model import Model | |
class OpenAI(Model): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
from typing import List, Dict, Any, Optional | |
from jinja2 import Environment, FileSystemLoader, meta | |
class Prompter: | |
def __init__( | |
self, | |
model, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABCMeta, abstractmethod | |
from typing import List, Optional, Union, Dict | |
import tenacity | |
class Model(metaclass=ABCMeta): | |
name = "" | |
description = "" | |
def __init__( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABCMeta, abstractmethod | |
from typing import List, Optional, Union, Dict | |
import tenacity | |
class Model(metaclass=ABCMeta): | |
name = "" | |
description = "" | |
def __init__( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict, List, Optional, Tuple, Union | |
import openai | |
import tiktoken | |
class OpenAI_Complete(Model): | |
name = "OpenAI" | |
description = "OpenAI API for text completion using various models" | |
def __init__( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from unittest.mock import MagicMock | |
class TestModel(unittest.TestCase): | |
def test_init(self): | |
model = MockModel("api_key", "mock_model") | |
self.assertEqual(model.api_key, "api_key") | |
self.assertEqual(model.model, "mock_model") | |
def test_supported_models(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
from basemodel import Model | |
class MockModel(Model): | |
@classmethod | |
def supported_models(cls) -> List[str]: | |
return ["mock_model"] | |
def _verify_model(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABCMeta, abstractmethod | |
from typing import List, Optional, Union, Dict | |
import openai | |
import tenacity | |
class Model(metaclass=ABCMeta): | |
name = "" | |
description = "" |