Skip to content

Instantly share code, notes, and snippets.

View ryanwang520's full-sized avatar

Haowei Wang ryanwang520

  • ArcSite
View GitHub Profile
def extract_product_attributes(product_name):
prompt = f"Given the product name '{product_name}', please provide its attributes in the following format:\nType: {{type}}\nMaterial: {{material}}\nSize: {{size}}\n\n"
response = openai.Completion.create(
engine="text-davinci-002",
prompt=prompt,
max_tokens=100,
n=1,
stop=None,
temperature=0, # Set temperature to a low value for more deterministic output
)
import uuid
from arcservice.core import db
from arcservice.models import Bundle, ProductCategory, ProductOptionSet
from arcservice.models.bundles.component import (
BundleOptionSet,
BundleProduct,
NestedBundle,
)
from arcservice.services.projects import product_svc
#!/usr/bin/env python
import pdb
import random
import datetime as dt
from venv import create
import pandas as pd
from dash import Dash, html, dcc, Input, Output, State, no_update, dash_table
import plotly.express as px
from datetime import date
#!/usr/bin/env python
import pdb
import random
import datetime as dt
from venv import create
import pandas as pd
from dash import Dash, html, dcc, Input, Output, State, no_update, dash_table
import plotly.express as px
from datetime import date
# -*- coding: utf-8 -*-
import dash
import dash_html_components as html
from dash.dependencies import Input, Output, State
from dash_table import DataTable
import pandas as pd
url = "https://github.com/plotly/datasets/raw/master/" "26k-consumer-complaints.csv"
# -*- coding: utf-8 -*-
import dash
import dash_html_components as html
from dash.dependencies import Input, Output, State
from dash_table import DataTable
import pandas as pd
url = "https://github.com/plotly/datasets/raw/master/" "26k-consumer-complaints.csv"
# -*- coding: utf-8 -*-
import dash
import dash_html_components as html
from dash.dependencies import Input, Output, State
from dash_table import DataTable
import pandas as pd
url = "https://github.com/plotly/datasets/raw/master/" "26k-consumer-complaints.csv"
from os import listdir
from dash import Dash, html, dcc, Input, Output, State, dash_table
import pandas as pd
import plotly.express as px
import random
from datetime import date
app = Dash(
from dash import Dash, html, dcc, Input, Output, State
import pandas as pd
import plotly.express as px
import random
from datetime import date
app = Dash(
__name__,
type ProductOptionSet = {
id: string;
name: string;
is_optional: boolean; // 是否可选
default_product_id?: string; // 默认选项
products: {
id: string;
uuid: string;
name: string;
}[];