Skip to content

Commit b3f0f73

Browse files
committed
add "ask ai" to docs
1 parent da7401d commit b3f0f73

4 files changed

Lines changed: 92 additions & 13 deletions

File tree

docs/http-reference/examples/openai-compliant/chatCompletionsExample.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Provides chat completions for all open source models that are `chat`, `audio-tex
99

1010
To specify a provider, prefix the model with the provider, e.g. `gpt-4` should be passed in as `openai/gpt4`
1111

12-
We provide free api access to models from `openai`, `mistral`, and `google`.
12+
We provide access to models from `openai`, `mistral`, and `google`.
1313

1414
You will need to supply a header `provider-key` in order to make requests to `anthropic`, and `cohere` models.
1515

docs/http-reference/examples/openai-compliant/completionsExample.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Provides completions for all open source models that are `text-generation`, it a
99

1010
To specify a provider, prefix the model with the provider, e.g. `davinci-002` should be passed in as `openai/davinci-002`
1111

12-
We provide free api access to models from `openai`, `mistral`, and `google`.
12+
We provide access to models from `openai`, `mistral`, and `google`.
1313

1414
You will need to supply a header `provider-key` in order to make requests to `anthropic`, and `cohere` models.
1515

docs/model-api/docs/welcome.mdx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
---
22
title: 'Welcome'
3-
description: '1 API Key. 175k+ models.'
3+
description: 'The unified API for 100,000+ AI models'
44
icon: 'hand-wave'
55
mode: 'wide'
66
---
77

8+
import { AskAI } from '/snippets/ask-ai.jsx';
89
import { tasks } from '/snippets/tasks.mdx';
910

10-
<Card
11-
arrow
12-
horizontal
13-
color="#6073BF"
14-
icon="circle-info"
15-
href="/model-api/docs/get-started"
16-
title="Are you new to Bytez?"
17-
>
18-
Get started by exploring our quick start guide.
19-
</Card>
11+
<AskAI />
2012

2113
<br />
2214

docs/snippets/ask-ai.jsx

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import { useState } from 'react';
2+
3+
export const AskAI = () => {
4+
const [question, setQuestion] = useState('');
5+
6+
const basePrompt = 'Search https://docs.bytez.com and answer: ';
7+
const encodedPrompt = encodeURIComponent(basePrompt + question);
8+
9+
const links = [
10+
{ name: 'ChatGPT', url: `https://chatgpt.com/?q=${encodedPrompt}` },
11+
{ name: 'Claude', url: `https://claude.ai/new?q=${encodedPrompt}` },
12+
{ name: 'Perplexity', url: `https://www.perplexity.ai/search?q=${encodedPrompt}` },
13+
];
14+
const handleKeyDown = (e) => {
15+
if (e.key === 'Enter' && question) {
16+
window.open(`https://chatgpt.com/?q=${encodeURIComponent(basePrompt + question)}`, '_blank');
17+
}
18+
};
19+
20+
return (
21+
<div
22+
style={{
23+
background: 'rgba(30, 32, 44, 0.6)',
24+
border: '1px solid rgba(96, 115, 191, 0.3)',
25+
borderRadius: '12px',
26+
padding: '24px',
27+
marginBottom: '24px',
28+
}}
29+
>
30+
<h3 style={{ margin: '0 0 8px 0', fontSize: '1.25rem', color: '#D0BCFF' }}>
31+
Ask AI about Bytez
32+
</h3>
33+
<p style={{ margin: '0 0 16px 0', opacity: 0.7, fontSize: '0.9rem' }}>
34+
Get instant answers from our docs
35+
</p>
36+
37+
<input
38+
type="text"
39+
placeholder="How do I run a model?"
40+
value={question}
41+
onChange={(e) => setQuestion(e.target.value)}
42+
onKeyDown={handleKeyDown}
43+
style={{
44+
width: '100%',
45+
padding: '12px 16px',
46+
fontSize: '1rem',
47+
marginTop: 8,
48+
border: '1px solid rgba(96, 115, 191, 0.3)',
49+
borderRadius: '8px',
50+
background: 'rgba(0,0,0,0.3)',
51+
color: 'inherit',
52+
marginBottom: '16px',
53+
boxSizing: 'border-box',
54+
}}
55+
/>
56+
57+
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap' }}>
58+
{links.map(({ name, url }) => (
59+
<a
60+
key={name}
61+
href={question ? url : '#'}
62+
target="_blank"
63+
rel="noopener noreferrer"
64+
onClick={(e) => !question && e.preventDefault()}
65+
style={{
66+
display: 'inline-flex',
67+
alignItems: 'center',
68+
gap: '8px',
69+
padding: '10px 20px',
70+
background: question ? '#E8DEF8' : 'rgba(96, 115, 191, 0.3)',
71+
color: question ? '#332D41' : 'white',
72+
borderRadius: '8px',
73+
textDecoration: 'none',
74+
fontWeight: 500,
75+
fontSize: '0.9rem',
76+
opacity: question ? 1 : 0.5,
77+
cursor: question ? 'pointer' : 'not-allowed',
78+
transition: 'all 0.2s',
79+
}}
80+
>
81+
{name}
82+
</a>
83+
))}
84+
</div>
85+
</div>
86+
);
87+
};

0 commit comments

Comments
 (0)