File size: 826 Bytes
b22f922
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from taskAI import TaskAI
from data_test import mock_jd, mock_cv
from config_secret import api_test

from llama_index.llms.openai_like import OpenAILike
from llama_index.core.llms import ChatMessage


def test_integration():
    messages = [
        ChatMessage(role="system", content="You are a helpful assistant"),
        ChatMessage(role="user", content="What is your name"),
    ]
    print("Testing integration:")
    response = OpenAILike(
        model=api_test["model"],
        api_key=api_test["key"],
        api_base=api_test["base"],
        max_retries=0,
        is_chat_model=True,
    ).chat(messages)
    print(response)

def test_taskAI():
    taskAI = TaskAI(api_test)
    gen = taskAI.cv_preprocess(mock_cv)
    for chunk in gen:
        print(chunk)

if __name__ == "__main__":
    
    # integration()