Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accept the terms #2639

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions bifrost/app/terms/page.tsx

Large diffs are not rendered by default.

172 changes: 146 additions & 26 deletions bifrost/components/layout/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,60 +52,180 @@ const Footer = () => {
const path = usePathname();

return (
<footer className={`grid grid-cols-2 md:grid-cols-5 py-6 gap-y-8 pl-8 md:pl-0 md:justify-items-center items-start ${path === "/" ? " bg-[#2B3AC7] text-white/70 fill-white stroke-white" : "bg-inherit text-black/60 fill-[#5D6673] stroke-[#5D6673]"}`}>

<footer
className={`grid grid-cols-2 md:grid-cols-5 py-6 gap-y-8 pl-8 md:pl-0 md:justify-items-center items-start ${
path === "/"
? " bg-[#2B3AC7] text-white/70 fill-white stroke-white"
: "bg-inherit text-black/60 fill-[#5D6673] stroke-[#5D6673]"
}`}
>
<div className="flex flex-col items-start font-light text-sm tracking-wide gap-1 col-span-2 md:col-span-1 justify-self-start md:justify-self-center">
<Image src="/static/logo-text.svg" alt="Bifrost" width={150} height={150} />
<Image
src="/static/logo-text.svg"
alt="Bifrost"
width={150}
height={150}
/>
<p className="mt-2">&copy; 2024 Helicone, Inc</p>
<p className="">All rights reserved.</p>
</div>


<div className="">
<p className="text-sm tracking-wide font-bold mb-2">INTEGRATIONS</p>
<div className="grid grid-cols-1 md:grid-cols-2 items-start font-light text-sm tracking-wide gap-x-8 gap-y-2">
<a className="hover:underline" href="https://docs.helicone.ai/integrations/openai/javascript" target="_blank">OpenAI</a>
<a className="hover:underline" href="https://docs.helicone.ai/integrations/anthropic/javascript" target="_blank">Anthropic</a>
<a className="hover:underline" href="https://docs.helicone.ai/integrations/azure/javascript" target="_blank">Azure</a>
<a className="hover:underline" href="https://docs.helicone.ai/getting-started/integration-method/litellm#litellm-integration" target="_blank">LiteLLM</a>
<a className="hover:underline" href="https://docs.helicone.ai/getting-started/integration-method/anyscale#anyscale-integration" target="_blank">Anyscale</a>
<a className="hover:underline" href="https://docs.helicone.ai/getting-started/integration-method/together#together-ai-integration" target="_blank">Together AI</a>
<a className="hover:underline" href="https://docs.helicone.ai/getting-started/integration-method/openrouter#openrouter-integration" target="_blank">OpenRouter</a>
<a className="hover:underline" href="https://docs.helicone.ai/getting-started/quick-start#other-integrations" target="_blank">Other</a>
<a
className="hover:underline"
href="https://docs.helicone.ai/integrations/openai/javascript"
target="_blank"
>
OpenAI
</a>
<a
className="hover:underline"
href="https://docs.helicone.ai/integrations/anthropic/javascript"
target="_blank"
>
Anthropic
</a>
<a
className="hover:underline"
href="https://docs.helicone.ai/integrations/azure/javascript"
target="_blank"
>
Azure
</a>
<a
className="hover:underline"
href="https://docs.helicone.ai/getting-started/integration-method/litellm#litellm-integration"
target="_blank"
>
LiteLLM
</a>
<a
className="hover:underline"
href="https://docs.helicone.ai/getting-started/integration-method/anyscale#anyscale-integration"
target="_blank"
>
Anyscale
</a>
<a
className="hover:underline"
href="https://docs.helicone.ai/getting-started/integration-method/together#together-ai-integration"
target="_blank"
>
Together AI
</a>
<a
className="hover:underline"
href="https://docs.helicone.ai/getting-started/integration-method/openrouter#openrouter-integration"
target="_blank"
>
OpenRouter
</a>
<a
className="hover:underline"
href="https://docs.helicone.ai/getting-started/quick-start#other-integrations"
target="_blank"
>
Other
</a>
</div>
</div>

<div className="">
<p className="font-bold text-sm tracking-wide mb-2">COMPARE</p>
<div className="flex flex-col items-start font-light text-sm tracking-wide gap-2">
<a className="hover:underline" href="/blog/best-langsmith-alternatives" target="_blank">Helicone vs Langsmith</a>
<a className="hover:underline" href="/blog/datadog" target="_blank">Helicone vs Datadog</a>
<a className="hover:underline" href="/blog/weights-and-biases" target="_blank">Helicone vs Weights & Biases</a>
<a
className="hover:underline"
href="/blog/best-langsmith-alternatives"
target="_blank"
>
Helicone vs Langsmith
</a>
<a className="hover:underline" href="/blog/datadog" target="_blank">
Helicone vs Datadog
</a>
<a
className="hover:underline"
href="/blog/weights-and-biases"
target="_blank"
>
Helicone vs Weights & Biases
</a>
</div>
</div>

<div className="">
<p className="font-bold text-sm tracking-wide mb-2">LEARN MORE</p>
<div className="flex flex-col items-start font-light text-sm tracking-wide gap-2">
<a className="hover:underline" href="https://docs.helicone.ai" target="_blank">Docs</a>
<a className="hover:underline" href="/blog" target="_blank">Blog</a>
<a className="hover:underline" href="/pricing" target="_blank">Pricing</a>
<a className="hover:underline" href="https://us.helicone.ai/open-stats" target="_blank">Stats</a>
<a className="hover:underline" href="/community" target="_blank">Community</a>
<a className="hover:underline" href="/changelog" target="_blank">Changelog</a>
<a
className="hover:underline"
href="https://docs.helicone.ai"
target="_blank"
>
Docs
</a>
<a className="hover:underline" href="/blog" target="_blank">
Blog
</a>
<a className="hover:underline" href="/pricing" target="_blank">
Pricing
</a>
<a
className="hover:underline"
href="https://us.helicone.ai/open-stats"
target="_blank"
>
Stats
</a>
<a className="hover:underline" href="/community" target="_blank">
Community
</a>
<a className="hover:underline" href="/changelog" target="_blank">
Changelog
</a>
<a className="hover:underline" href="/terms" target="_blank">
Terms
</a>
<a className="hover:underline" href="/privacy" target="_blank">
Privacy
</a>
</div>
</div>

<div className="">
<p className="font-bold mb-2 text-sm tracking-wide">CONNECT</p>
<div className="flex flex-col items-start font-light text-sm tracking-wide gap-2">
<a className="hover:underline" href="https://twitter.com/helicone_ai" target="_blank">Twitter</a>
<a className="hover:underline" href="https://www.linkedin.com/company/helicone/" target="_blank">LinkedIn</a>
<a className="hover:underline" href="https://discord.gg/2TkeWdXNPQ" target="_blank">Discord</a>
<a className="hover:underline" href="mailto:[email protected]" target="_blank">Email</a>
<a
className="hover:underline"
href="https://twitter.com/helicone_ai"
target="_blank"
>
Twitter
</a>
<a
className="hover:underline"
href="https://www.linkedin.com/company/helicone/"
target="_blank"
>
LinkedIn
</a>
<a
className="hover:underline"
href="https://discord.gg/2TkeWdXNPQ"
target="_blank"
>
Discord
</a>
<a
className="hover:underline"
href="mailto:[email protected]"
target="_blank"
>
Email
</a>
</div>
</div>

</footer>
);
};
Expand Down
37 changes: 32 additions & 5 deletions clickhouse/ch_hcone.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import time
import re
import getpass
import tabulate

file_dir = os.path.dirname(os.path.realpath(__file__))
schema_dir = os.path.join(file_dir, 'migrations')
Expand All @@ -15,7 +16,7 @@


def schema_sort_key(filename):
match = re.search(r'schema_(\d+)', filename)
match = re.search(r'schema_(\d+)', os.path.basename(filename))
return int(match.group(1)) if match else -1


Expand All @@ -31,13 +32,17 @@ def get_host(host: str):
def run_curl_command(query, host, port, user=None, password=None, migration_file=None):

if not query:
curl_cmd = f"cat \"{migration_file}\" | curl '{get_host(host)}:{port}/' --data-binary @-"
curl_cmd = f"cat \"{migration_file}\" | curl '{
get_host(host)}:{port}/' --data-binary @-"
if user and password:
curl_cmd = f"cat \"{migration_file}\" | curl --user '{user}:{password}' '{get_host(host)}:{port}/' --data-binary @-"
curl_cmd = f"cat \"{migration_file}\" | curl --user '{user}:{
password}' '{get_host(host)}:{port}/' --data-binary @-"
else:
curl_cmd = f"echo \"{query}\" | curl '{get_host(host)}:{port}/' --data-binary @-"
curl_cmd = f"echo \"{query}\" | curl '{
get_host(host)}:{port}/' --data-binary @-"
if user and password:
curl_cmd = f"echo \"{query}\" | curl --user '{user}:{password}' '{get_host(host)}:{port}/' --data-binary @-"
curl_cmd = f"echo \"{
query}\" | curl --user '{user}:{password}' '{get_host(host)}:{port}/' --data-binary @-"

result = subprocess.run(curl_cmd, shell=True,
capture_output=True, text=True)
Expand Down Expand Up @@ -110,6 +115,22 @@ def run_migrations(host, port, retries=5, user=None, password=None):
print('Finished running migrations')


def list_migrations(host, port, user=None, password=None):
query = '''
SELECT migration_name, applied_date
FROM helicone_migrations
ORDER BY migration_name;
'''
res = run_curl_command(query, host, port, user, password)
migrations = [line.split('\t') for line in res.stdout.strip().split('\n')]

# Sort migrations based on schema version number
migrations.sort(key=lambda x: schema_sort_key(x[0]))

headers = ['Migration Name', 'Applied Date']
print(tabulate.tabulate(migrations, headers=headers, tablefmt='grid'))


def main():
parser = argparse.ArgumentParser(
description='Helicone CLI tool to manage migrations and start services'
Expand All @@ -129,6 +150,8 @@ def main():
parser.add_argument('--port', default='18123',
help='ClickHouse server port')
parser.add_argument('--user', help='ClickHouse server user')
parser.add_argument('--list-migrations', action='store_true',
help='List applied migrations')

args = parser.parse_args()

Expand Down Expand Up @@ -191,6 +214,10 @@ def main():
create_migration_table(args.host, args.port, args.user, password)
run_migrations(args.host, args.port, user=args.user, password=password)

elif args.list_migrations:
print('Listing applied migrations')
list_migrations(args.host, args.port, args.user, password)

else:
print('No action specified')

Expand Down
26 changes: 26 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -11202,6 +11202,32 @@
}
}
},
"/v1/organization/user/accept_terms": {
"post": {
"operationId": "AcceptTerms",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result_null.string_"
}
}
}
}
},
"tags": [
"Organization"
],
"security": [
{
"api_key": []
}
],
"parameters": []
}
},
"/v1/organization/create": {
"post": {
"operationId": "CreateNewOrganization",
Expand Down
13 changes: 13 additions & 0 deletions helicone-node/api/generatedTypes/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ export interface paths {
"/v1/customer/query": {
post: operations["GetCustomers"];
};
"/v1/organization/user/accept_terms": {
post: operations["AcceptTerms"];
};
"/v1/organization/create": {
post: operations["CreateNewOrganization"];
};
Expand Down Expand Up @@ -4008,6 +4011,16 @@ export interface operations {
};
};
};
AcceptTerms: {
responses: {
/** @description Ok */
200: {
content: {
"application/json": components["schemas"]["Result_null.string_"];
};
};
};
};
CreateNewOrganization: {
requestBody: {
content: {
Expand Down
24 changes: 24 additions & 0 deletions valhalla/jawn/src/controllers/private/organizationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@ import { StripeManager } from "../../managers/stripe/StripeManager";
@Tags("Organization")
@Security("api_key")
export class OrganizationController extends Controller {
@Post("/user/accept_terms")
public async acceptTerms(
@Request() request: JawnAuthenticatedRequest
): Promise<Result<null, string>> {
if (!request.authParams.userId) {
return err("User not found");
}

const result = await supabaseServer.client.auth.admin.updateUserById(
request.authParams.userId,
{
user_metadata: {
accepted_terms_date: new Date().toISOString(),
},
}
);

if (result.error) {
return err(result.error.message);
}

return ok(null);
}

@Post("/create")
public async createNewOrganization(
@Body()
Expand Down
Loading
Loading