forked from bkpradhan/genai-openai-chatgpt-langchan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.py
50 lines (45 loc) · 1.6 KB
/
functions.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import json
import os
from langchain.chat_models import ChatOpenAI
from langchain.chains import LLMChain
from dotenv import find_dotenv, load_dotenv
from langchain.prompts.chat import (
ChatPromptTemplate,
SystemMessagePromptTemplate,
HumanMessagePromptTemplate,
)
from datetime import datetime, timedelta
load_dotenv(find_dotenv())
def get_order_desc(order_id):
"""
In this example, the function converts the input order id to a descriptive text message.
"""
if order_id.startswith(('XMP', 'XMA', 'XAC')):
response="the order is an Advisory Order"
elif order_id.startswith(('GPQ', 'XYZ', 'PQR')):
response="the order is a Brokerage Order"
else:
response ="the order is External FIX Clients"
return response
def show_log_entries(order_id):
"""
In this example, the function converts the input order id to a descriptive text message.
"""
if order_id.startswith(('XMP', 'XMA', 'XAC')):
response="the order is an Advisory Order"
elif order_id.startswith(('ABC', 'XYZ', 'PQR')):
response="the order is a Brokerage Order"
else:
response ="the order is External FIX Clients"
return response
def get_order_activities(order_id):
"""
In this example, the function converts the input order id to a descriptive text message.
"""
if order_id.startswith(('XMP', 'XMA', 'XAC')):
response="the order is an Advisory Order"
elif order_id.startswith(('ABC', 'XYZ', 'PQR')):
response="the order is a Brokerage Order"
else:
response ="the order is External FIX Clients"
return response